[MUD-Dev] Question about copyovers.

Kwon Ekstrom justice at softhome.net
Wed May 15 23:44:20 New Zealand Standard Time 2002


Sorry I haven't replied to this thread before, I had meant to, but
I've got some pretty tight deadlines for a demo of software for
work...

From: "Anderson, David" <david.anderson at tfp.com>
> From: Tand'a-ur [mailto:tandaur at ix.netcom.com]

>> You write the descriptor numbers and other info like player names
>> into a file and then you run the mud again with some option that
>> tells the mud to look for that file and load up the players from
>> it.  Then the old instance of the mud is ended.

Yup, that's exactly how it's done in Erwin's Copyover code.  A few
problems in Java, from what I've noticed, you pick up the sockets in
the child by referencing the descriptors/memory occupied by the
descriptors... then failing to close them out on the original
process giving the child process full control.

You can't do this in java.  First, Java sockets don't allow you to
access the descriptors directly.  Second, Java doesn't allow you to
access the memory or file handles directly.

It's the way java hides this to provide stable cross-platform
compliance which causes your problems.  You have a variety of
options.

You can create a library with code to handle your networking for you
and access it using the JNI.

Another thought I've come up with, but haven't had time to put it
thru it's paces is to create a "parent" process which handles all of
your connections.  Your mud server and everything EXCEPT the
connections is run as a child process... and using the standard
input/output you pass an integer (user number) and string (input
text) to the child process.  For a copyover you can then simply
close the child process and restart it, then pass it the references
to your sockets.

It'd also be able to act as your startup script in case of a crash.

The major problem I have with this is you're parsing your data
twice... this can have a benefit in allowing you to distribute your
network, but when on the same machine can do little but lower
overall performance, you're sending your data repeatedly.  I haven't
had time to test it and see if it has acceptable performance.

> Yeah, I've seen the normal C copyover code that everyone has.
> Maybe I'm just a bit lost on the descriptor idea.  What descriptor
> numbers are there I could get when people connect to my sockets,
> and how would those numbers in the files be useful to me?  Is
> there a way to connect to those sockets that are connected to a
> different process if I run the mud again?

See above, hope it answers your questions.

Me and Scion Altera have spent alot of time working on Copyover
ideas for a java based mud, so if anyone solves the problem, there's
definitely interest.

-- Kwon J. Ekstrom

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the MUD-Dev mailing list