def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, _timeout=None, _sock=None, _proactor_added=False): self._fd = _sock or stdsocket(family, type, proto) self._fd.setblocking(0) self._timeout = _timeout or _TIMEOUT self._proactor_added = _proactor_added
def _GetTransmitFilePtr(given_socket=None): bogus_sock = given_socket or stdsocket() bogus_bytes = DWORD() TransmitFile = TransmitFileType(0) ret = WSAIoctl( bogus_sock.fileno(), SIO_GET_EXTENSION_FUNCTION_POINTER, byref(WSAID_TRANSMITFILE), sizeof(WSAID_TRANSMITFILE), byref(TransmitFile), sizeof(TransmitFile), byref(bogus_bytes), None, None ) return TransmitFile
def _GetConnectExPtr(given_socket=None): bogus_sock = given_socket or stdsocket() bogus_bytes = DWORD() ConnectEx = ConnectExType(0) ret = WSAIoctl( bogus_sock.fileno(), SIO_GET_EXTENSION_FUNCTION_POINTER, byref(WSAID_CONNECTEX), sizeof(WSAID_CONNECTEX), byref(ConnectEx), sizeof(ConnectEx), byref(bogus_bytes), None, None ) return ConnectEx