Sockets on Windows and Mac

Peter Hansen peter at engcorp.com
Sun Jan 8 10:43:08 EST 2006


rodmc wrote:
> I am new to Python and have been writing some socket based programmes
> on Windows (with some success), however I am unable to get them to work
> on Mac.
> 
> Are there differences in the way the socket module works on Windows and
> Mac? I would appreciate any simple code samples people my have for
> creating a very basic server on Macpython, I have copied code from
> various tutorials but as yet they don't appear to work.

Aren't you basing this on the standard library modules such as 
SocketServer, or extension packages like Twisted, that already do most 
of the work for you?  If you were, you likely wouldn't have to deal with 
any such Mac-specific problems (if that's really what they are) and you 
would likely save yourself a whole heck of a lot of time reinventing the 
wheel too.  (Note also that most people doing raw socket programming do 
it wrong, which is a good reason to jump straight ahead to build on the 
work of others.)

-Peter




More information about the Python-list mailing list