As far as the portability issues are concerned, have you tried using
Java?
I am developing a new codebase, and it is working out pretty well so
far, with no speed issues, etc. Plus, it is pretty easy to program a
socket server in Java. In fact I got my basic code from volume 2 of a
book called Core Java 2.0. In the Networking chapter they have a fully
functioning threaded echo server that sounds like exactly what you are
looking for.

The webpage is : http://www.horstmann.com/corejava.html - You can
download the source code from here.

Hope this helps!

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yun Zhou
Sent: Tuesday, July 29, 2003 8:43 PM
To: Jed Yang
Cc: [email protected]
Subject: Re: Copyright/credits question.

I'm currently working on my own codebase because of the fact that adding
onto 
ROM is getting tiring and though my telnet core is not totally
functional 
yet, I have done a totally different approach from ROM.

First off, I forgoed the process of having the giant game loop that ROM
uses 
and decided for a multithreaded system instead. Every user has their own

threads, 1 which handles and interprets the input, and another that does
the 
output. When a user pages another user, or the system pages one of them,
it 
posts a semaphore for the output thread to output to that user's
descriptor.

This system that I have described is much better in performance than the

looping system, because it is event based, hogging CPU cycles only when 
needed, unlike ROM, which polls all descriptors regardless of whether
they 
are active or not. There is a update thread that unblocks every few
minutes 
and does the updating of the areas database (I have made it use SQL to
handle 
the DB tasks, unlike ROM, which has its own system)

Some helpful resources to get you stared are as follows:
"Advanced Linux Programming" -- Mark Mitchell
"Linux Sockets Programming" -- Sean Walton

Those were the only two books that I needed to take care of the specific

information about the threads and the sockets. 

And if you can't afford/find these books at a library, there are plenty
of 
resources online that you can refer to. Here are some good ones:

http://www.fortunecity.com/skyscraper/arpanet/6/cc.htm
http://scitsc.wlv.ac.uk/~jphb/comms/sockets.html

Hope that helps!

On Tuesday 29 July 2003 06:14, Jed Yang wrote:
> Hello all,
>
> I am planning to write a server that handle telnet connections.
> I am not sure if it is going to evolve into a mud, or simply a chat or
> boards.
> Therefore it is of course not a `ROM' derivative.
> Yet I am most used to the ROM mud, (since I programmed for a ROM mud
and
> thus subscribing to this list for quite a while), and I am quite bad
at
> socket programming (or whatever it is called), so I might need to
> `borrow' the ROM connection code.
> Only the basic part will be borrowed:
>  + main
>    o init_socket and its necessary child
>    o game_loop_unix (only the connection part extracted)
>      - init_descriptor
>        = write_to_buffer
>      - read_from_buffer
>      - read_from_descriptor
>  + DESCRIPTOR_DATA struct minimal need
>  + and any other that I missed but is essential (please enlighten me,
> thanks)
> After reviewing the ROM/Merc/DIKU licenses, it seems that I will need
to
> put the original authors name on my logon screen, even though if I am
> only using the connection part, not even using command intepretor,
> pulse, CHARACTER_DATA, etc.
>
> So I have a question, is there a way around it (I do not mean to sneak
> holes past the licenses, but other than writing my own code to handle
> sockets and descriptors, is there any way to do it? Or could someone
> point to a minimal socket code (for instance, just echoing what you
> typed in and responding to only `quit'). If possible, I actually want
> the code to work for Win32, so I can test all non-connection related
> functions on my laptop and host the final project back on an Unix
> machine. I am actually not sure at all how hard it is to write such a
> code, i.e. if it is possible for one of you to write it in a few
minutes
> or will it take hours? Any response will be appreciated. Thank you.
>
> Sincerely,
>
> Jed Yang (Htam)


-- 
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom

Reply via email to