[MUD-Dev] Re: Yet another update on threads and signals
Adam J. Thornton
adam at phoenix.Princeton.EDU
Sun Aug 16 12:06:54 CEST 1998
On Sat, Aug 15, 1998 at 02:54:10PM -0600, Chris Gray wrote:
> Actually, since you said the distributer creates the processes for
> newly active rooms, I would have it create the socket, too. Then the
> new room process would simply open it, by name, to have its connection
> to the distributer. Note that these AF_UNIX sockets are strictly local
> to your one computer, and so their port numbers are an irrelevant
> detail - no process ever needs to know what they are. Actually, with
> named sockets this way, you don't need to bounce things through the
> distributer, come to think of it! To pass a player from one process
> to another, just have the old room open the local socket to the new room,
> write the info (and client socket) down it, then close it again. The new
> room knows that only transfer messages come over its local socket,
> so it knows to handle it different than stuff coming over client sockets.
Oooh, I _like_ this. So you simply have an AF_UNIX socket open, and have a
thread in each room blocking on reading it. When it gets something it
pulls the fd that I've passed though it out, and that's the new player
connection in that room; the other thing I need to do is pass a player
identifier down the same pipe, so the room process knows which object tree
to grab hold of and assign to the new player thread. Cool.
Thanks bunches. I *like* this design.
Adam
--
adam at princeton.edu
"There's a border to somewhere waiting, and a tank full of time." - J. Steinman
More information about the mud-dev-archive
mailing list