[MUD-Dev] Re: mud client development systems

Per Vognsen vognsen at post10.tele.dk
Sun Dec 13 14:18:53 CET 1998


Sunny Gulati wrote:

[snip]
> b) Regarding running my protocol through a second socket, seperate from
> the telnet session:
> 
> I'm thinking, "how would I set this up"?  Two options:
> 
> option 1.  Mud connects back to the client, like FTP.    Bad because
> firewalls won't let people through and stuff.

You're right about the firewall part. Also, unless you use an external
process to connect to the client, you'd run out of file descriptors; you
would basicly have 2 file-descriptors for each player, instead of 1.

> option 2.  Client connects to mud at specific socket number. (has to be
> specific, because even right now we're tunneling a hole to our mud
> through a firewall on a specific port number).  How then do I associate
> the 2nd socket connection with the original player object?
> 
> I suppose that I could tell the client some sort of secret passphrase,
> and it sends that back along the second socket and that's how I make the
> association.  (throw in in some public key cryptography in later
> generations).

Well, my suggestion is this (which is more-or-less what you proposed
yourself):

1. Setup a server socket on a port (either using socket-efuns or by
specifying an extra connection socket (ASCII or binary) in the
configuration file.
2. Setup callbacks (incoming, read, write) for the server socket.
3. The incoming callback (which, obviously, gets called when someone
connects) could/should check if there's any character(s) logged on which
has connected from the same IP as this connection. If there is,
associate the new socket with the player object.
4. The receive() apply should check if it has a pointer to the
client-control socket. If it has, it should send special binary (or
ASCII if that's your preference) to the client-control socket.

That's it! It hasn't been tried out, of course, but it should work.
There's probably a lot more elegant solution to this problem, but this
one was at the top of my head when writing this message.

PS. Has anyone running an LPMUD (i.e. MudOS, Amylaar, etc.) tried to use
a multiplexer for socket connections? This allows a very great number of
open sockets without increasing the kernel file descriptor limit.

- Per Vognsen




More information about the mud-dev-archive mailing list