[MUD-Dev] Questions about server design

Sean Middleditch elanthis at awesomeplay.com
Tue May 7 08:17:09 CEST 2002


On Sat, 2002-05-04 at 22:11, Ben Chambers wrote:

> First question, is about the new java.nio classes introduced in
> version 1.4.  I've seen a lot of information using them as simple
> echo servers, but not much on expanding that to something like a
> chat server or beyond.  What would be the best way of handling
> this?  It seems from what i've read that you can't write until
> you're done reading.  This would suggest some form of queue, but
> it would get costly to have that many messages in a queue for each
> person.  I was thinking of some form of global queue, where each
> person has his or her point in that, and every time you'd write it
> would advance your spot, but that runs into some problems as well.
> How would you implement a non-blocking, possibly multithreaded in
> order to improve response time, server?  If you did multi-thread
> it, how do you handle communication between the threads?  What
> system do you use to divide the incoming connections?

I can't comment on that - I'm trying to figure out the best way
myself before multi-threading my codebase ~,^

> Second question, how plausible is XML as a format for MUD data
> files as opposed to a SQL based database?  Would it be fast enough
> using the java classes to parse it to create a XML based format
> for my MUD data files instead of using SQL?  This idea appeals to
> me because it makes it easier to write object oriented data files
> that take into account inheritance and stuff, but I don't know if
> the load times would be drastically reduced.

Actually, my codebase uses nothing but XML.  And it works great.
Easy to edit the files without an on-line builder (which I don't
have, yet).

Just realize, tho, that once you multi-thread your server, trying to
sync the data can be hard.  This is where having a separate,
advanced DB (be it SQL or whatever else) can be very helpful.
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list