[MUD-Dev] OT: Socket programming - platform specific

Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
Fri Jan 23 07:51:43 CET 1998


[Jon Lambert:]

:Win32s,Win95 and WinNT sockets programming is virtually identical to
:Unix BSD sockets.

Nod. Socket programming experience, at least at the level normally needed
for MUDs, should be interchangeable between UNIX and Win32. The *only*
Windows program I've done was to port my ToyMUD server to it, and the
changes were small (mostly involving the points Jon has mentioned about
the WSAStartup and WSAGetNextError stuff). I did find that WinSock is
a bit pickier than UNIX - it cared about a wrongly initialized family in
an address, whereas UNIX didn't. The one issue I did not manage to resolve
is that of shutdown - a control-C typed in the shell window running the
server creates a thread in the server process, but does *not* interrupt
any currently executing WinSock call. So, using that technique to shut
down your server isn't fully satisfactory. However, WinSock seems to
silently shorten the waits on 'select' to about 10 seconds, so if you
have a 'ShutDown' flag which is checked in your main idle loop, you'll
end up shutting down within 10 seconds of the control-C.

--
Chris Gray   cg at ami-cg.GraySage.Edmonton.AB.CA



More information about the mud-dev-archive mailing list