OT: Socket programming - platform specific

Jon A. Lambert jlsysinc at ix.netcom.com
Thu Jan 22 18:35:24 CET 1998


On 22 Jan 98 at 13:19, Richard Woolcock wrote:
> Vadim Tkachenko wrote:
> > 
> > Richard Woolcock wrote:
> > 
> > [skipped]
> > 
> > > Out of interest, can anyone recommend a good book on socket programming?
> > > It a skill I'm sadly lacking to any useful degree...all I need to do then
> > > is work out how to draw a pixel on the screen, and the rest I can do ;)
> > 
> > You don't have to be _really_ good at sockets. I don't know how that
> > applies to your programming environment (what is it, can you please
> > remind?), but for me (C++, then Java) just the generalization of sockets
> > as streams worked pretty good - keeping in mind the reusability as well.
> 
> Hmmm well I'd like to get a front end (probably in C++) which would run
> under DOS or windows, and the mud part (which I can probably manage just
> about) running under Linux/FreeBSD/NetBSD.
> 

Win32s,Win95 and WinNT sockets programming is virtually identical to
Unix BSD sockets.  The only calls that are not supported are read() and 
write().  This is because Win does not treat sockets as extensions of the
file handling system.  You must use send() and recv().  There are 
two calls WSAStartup and WSACleanup that must be used to load the DLL
and shut it down gracefully.  And there are are number of extensions 
for ASYNC versions of lookup functions (WSAAsyncGetHostByName(), etc.)
and for setting your own blocking hooks.  Error handling is very well
done and easy to use with WSAGetLastError() and WSASetLastError(). 

DOS does not support sockets, although there are a couple of freely
available libraries.  Check out <http://www.delorie.com/>.  I haven't
tries any of them though.

If you have any specific questions, drop me an E-Mail... 

--
--/*\ Jon A. Lambert - TychoMUD     Internet:jlsysinc at ix.netcom.com /*\--
--/*\ Mud Server Developer's Page <http://www.netcom.com/~jlsysinc> /*\--
--/*\   "Everything that deceives may be said to enchant" - Plato   /*\--



More information about the mud-dev-archive mailing list