Sockets/select: how to deal with multiple connections in threads?

Donn Cave donn at drizzle.com
Sun May 26 12:43:02 EDT 2002


Quoth Irmen de Jong <irmen at USENET_NOSPAM_REMOVETHISxs4all.nl>:
...
| My solution is currently to have *another* server socket, and a
| loopback socket to that socket. The select() will wait on this 'signal'
| server socket too. The thread will write a character to the loopback
| socket, and so the select() in the main loop breaks and my cycle continues.
|
| I'm not too happy with this solution. Who has a better idea?
| What is usually done to abort a select()?  (has to work on Windows too)

It's a nuisance, but in principle I think your design is not a bad one,
to make I/O the common base of your event handling.  If you can find
a way around it that's more convenient, that's great, but I don't think
you'll find a more powerful and portable event dispatching architecture.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list