[python-win32] Immediately disconnecting a socket in Windows
Marte Soliza
myrtactle at gmail.com
Thu Aug 13 19:17:44 CEST 2009
I'm using httplib as an HTTP client for a custom HTTP server. One thing I
need is to be able to immediately force disconnect a request that takes too
long on the server side (and hasn't returned any data) or if the connection
becomes problematic to the point that no data returns for a long period of
time. The blocking part happens when getresponse is being called on the
HTTPConnection object. In Linux, on a separate thread, I can call shutdown
on the socket of the connection object and the getresponse call immediately
raises an error. However, in Windows (XP SP3 in particular), this seems to
be not the case. It still waits for the server to communicate something
back. Do I need to call a Windows-specific function to achieve the same as
in Linux?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20090814/1aa80b1c/attachment.htm>
More information about the python-win32
mailing list