On 26/11/2012 11:49am, Kristján Valur Jónsson wrote: > However, other implementations of python sockets, e.g. ones that rely on > IO completion, may not have the luxury of using select. For example, on > Windows, there is no way to abort an IOCP socket call, so a timeout must > be implemented by aborting the wait. Dealing with the resulting race > can be an interesting challenge. I am not quite sure what you mean by "aborting the wait". But you can abort an overlapped operation using CancelIo()/CancelIoEx(). I have just done some experimenting. Using CancelIo()/CancelIoEx() to abort an operation started with WSARecv() does not seem to cause a problem -- you just call GetOverlappedResult() afterwards to check whether the operation completed before it could be aborted. But aborting an operation started with WSASend() sometimes seems to "break" the connection: a subsequent WSARecv()/WSASend() will fail with WSAECONNABORTED or WSAECONNRESET depending on which end of the connection you are on. So, as you say, if you abort a send then you cannot expect to successfully resend the data later. -- Richard
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4