How to stop a listening socket.accept()?

Donn Cave donn at
Sat Mar 13 08:09:25 CET 2004

Quoth "kvdvm" <kvdvm at>:
| It seems that the accept() method acts as stubborn as a mule to get a 
| connection request even if I close it in another thread.
| Any idea will be deeply appreciated.

Do you mean, the thread continues to block in accept?  In this
case, you can use select with a timeout, or maybe your second
thread could just connect and send a special shut down message.

	Donn Cave, donn at

More information about the Python-list mailing list