MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: [MUD-Dev] OT: Socket programming - platform specific
On 23 Jan 98 at 7:57, Chris Gray wrote:
> [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).
^^^^
<heh> I wish I had the above function. It sure would make debugging
easier. Sort of a kernel precognition function. ;)
> 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.
A possible solution is to install a SIGINT handler and from within it
call WSACancelBlockingCall() followed by WSACleanup(). It should cancel
outstanding Select()'s.
--
--/*\ Jon A. Lambert - TychoMUD Internet:jlsysinc#ix,netcom.com /*\--
--/*\ Mud Server Developer's Page <http://www.netcom.com/~jlsysinc> /*\--
--/*\ "Everything that deceives may be said to enchant" - Plato /*\--
- Thread context:
- Re: [MUD-Dev] Clients based on Netscape 5?, (continued)
- Clients based on Netscape 5?,
Greg Munt greg#uni-corn,demon.co.uk, Sat 24 Jan 1998, 01:16 GMT
- Re: [MUD-Dev] OT: Socket programming - platform specific,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Fri 23 Jan 1998, 15:49 GMT
- RE: [MUD-Dev] Graphical mud perspectives,
Koster, Raph rkoster#origin,ea.com, Fri 23 Jan 1998, 15:47 GMT
[ Other Periods
| Other mailing lists
| Search
]