1
# Copyright (c) 2008 Twisted Matrix Laboratories.
2
# See LICENSE for details.
5
def connect(long s, object addr, object obj):
10
if not have_connectex:
11
raise ValueError, 'ConnectEx is not available on this system'
13
family = getAddrFamily(s)
15
fillinetaddr(<sockaddr_in *>&name, addr)
17
raise ValueError, 'unsupported address family'
18
name.sa_family = family
22
ov.obj = <PyObject *>obj
24
rc = lpConnectEx(s, &name, sizeof(name), NULL, 0, NULL, <OVERLAPPED *>ov)
27
rc = WSAGetLastError()
28
if rc != ERROR_IO_PENDING:
31
# operation is in progress