So, I guess my question after all the blathering is what's the best way
to handle these disconnects? Should the client send a message saying
that it's disconnecting, then have the host do a breakConnection, and
finally have the client kill the MUS instance? Or is it simply a problem
of trying to run the client and host from the same box?

Hi. I am not sure what is happening particularly with your app, but the server "knows" when the client has disconnected, because the TCP session is interrupted (sockets are closed, etc.). The 10 minutes timeout is there just in the rare cases where the connection is interrupted in abnormal ways (as when you pull the network plug, for example.) When an user leaves it broadcasts at least a system.group.leave message if I remember correctly, so other users in the same group can simply pick up this.
But in any case you can instruct SMUS (or our Nebulae) to notify a group when the user disconnects. See


http://xtras.tabuleiro.com/products/nebulae/help/moviecfg.htm

The option you want to use is the NotifyDisconnect. From the page above:

#NotifyDisconnect = @MonitorGroup
#-- Name of a group that will receive disconnection messages
#-- every time an user leaves the movie.
#-- The NotifyDisconnect group solves a common problem faced by
#-- many multiuser applications. Sometimes there is a connection
#-- problem and one participant looses its connection to the server
#-- before disconnection messages can be issue to other users of
#-- the same movie.
#-- A common workaround was to have all clients polling the server
#-- for a list of connected users periodically to check for
#-- disconnections, but this solution is a waste of bandwidth and
#-- server resources. Using NotifyDisconnect you can specify a group
#-- (it can be @AllUsers) and its members will receive a special
#-- message every time an user is disconnected from the server,
#-- for any reason. The message has the senderID "System"
#-- and the subject "Disconnected". The content portion of the
#-- message contains the name of the user disconnected.

The Multiuser API is very complex, it takes a while to understand exactly how to use it and how to optimize your apps for it. I recommend checking out GoMu:

http://gomu.rebus.gr/

It is a set of scripts that wraps the MultiUser API in a very friendly way, it can save you days of work trying to figure it out how to optimize your callbacks, etc. Alchemist has already done this for you!

Regards,
Mauricio
Tabuleiro
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to