need help with recieving sockets

Peter Hansen peter at engcorp.com
Sun Dec 18 20:40:16 EST 2005


Andrew wrote:
> Hi I was wondering if any one could help me with a chat client I am 
> writing my main issue is not in the sending of messages or in the 
> connection setting.

Your main issues should probably include those things and more.  Judging 
by the simplistic way you are attempting to get this to work, you 
probably haven't read the following tutorial (see link below).

I strongly recommend you read that, and then _don't_ reinvent the wheel 
but instead learn to use an existing package that hides many of these 
mundane and difficult-to-get-right details from you.

The "asyncore" package in the standard library or Twisted are two 
approaches, or you could learn about SocketServer and others also in the 
standard library and use them instead.

http://www.amk.ca/python/howto/sockets/


-Peter




More information about the Python-list mailing list