win32file.AcceptEx
AcceptEx(sListening, sAccepting, buffer, ol)
Version of accept that uses Overlapped I/O
Parameters
Comments
In order to make sure the connection has been accepted, either use the hEvent in PyOVERLAPPED, GetOverlappedResult, or GetQueuedCompletionStatus.To use this with I/O completion ports, don't forget to attach sAccepting to your completion port.
Pass a buffer of exactly the size returned by win32file::CalculateSocketEndPointSize to have AcceptEx return without reading any bytes from the remote connection.
Example
To have sAccepting inherit the properties of sListening, you need to do the following after a connection is successfully accepted
import struct sAccepting.setsockopt(socket.SOL_SOCKET, win32file.SO_UPDATE_ACCEPT_CONTEXT, struct.pack("I", sListening.fileno()))
Return Value
The result is 0 or ERROR_IO_PENDING. All other values will raise win32file.error. Specifically: if the win32 function returns FALSE, WSAGetLastError() is checked for ERROR_IO_PENDING.