Server Socket example

Gerhard Häring gh at ghaering.de
Fri May 16 09:20:31 EDT 2003


giacomo wrote:
> Hello, 
> 
> To the people like me, who want to begin whith the network programming
> in Pyhton, this is a link (thanks David Shaffer, the author) of a Talk
> server (multi-client) with thread, etc..
> 
> It uses the SocketServer.ThreadingTCPServer class.
> 
> http://www.cs.westminster.edu/~shaffer/DistributedComputing/WS99Part1/Code/Python/Talk/
> 
> class : TalkClient.py, TalkChannel.py, TalkServer.py
> 
> But there is a pb in the script for win:
> inputFrom, dummy, dummy = select([con, sys.stdin], [], [])
> 
> select doesn't work with sys.stdin in windows
> 
> How to modify this script for win?

I can only think of an ugly workaround involving threads.

> Any ideas?

You could install Cygwin and use the Cygwin Python instead. Under 
Cygwin, select.select *does* work with sys.stdin. I just tried it.

-- Gerhard





More information about the Python-list mailing list