Sockets and time-outs

pehr anderson pehr at pehr.net
Thu Aug 17 00:38:54 EDT 2000


A coworker of mine, Tim O'malley has recently written
a package for timeouts on sockets. It basically 
overrides the existing sockes library and lets you 
set timeouts as desired, as if the base libraries 
had this magic functionality.

I don't have the URL, but his Email address is timo at eink.com
	-pehr


Ulf Engstrøm wrote:
> 
> I'm using the socket module for a program, but there's one thing that I want
> to improve on it.
> The client side of this sends data to the server and always get a reply
> back, but sometimes the server sends something that wasn't requested of the
> reply comes in two sends. Thus I need to read the socket sometimes to see if
> there's something waiting. Using recv() is great for getting a reply I know
> is there, but when using it and there's no message there it takes an awfully
> long time to time out and waiting for this time-out blocks the sending on
> the same socket. Is there any way to set a shorter time-out (basically just
> check for 2 secs or so) or is there an other function for this?
> Regards
> Ulf



More information about the Python-list mailing list