Beispiel #1
0
 def handle_connect_event(self):
     err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
     if err != 0:
         raise socket.error(err, _strerror(err))
     self.handle_connect()
     self.connected = True
     self.connecting = False
Beispiel #2
0
 def handle_connect_event(self):
     err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
     if err != 0:
         raise socket.error(err, _strerror(err))
     self.handle_connect()
     self.connected = True
     self.connecting = False
Beispiel #3
0
 def connect(self, address):
     self.connected = False
     self.connecting = True
     err = self.socket.connect_ex(address)
     if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \
     or err == EINVAL and os.name in ('nt', 'ce'):
         self.addr = address
         return
     if err in (0, EISCONN):
         self.addr = address
         self.handle_connect_event()
     else:
         raise socket.error(err, errorcode[err])
Beispiel #4
0
 def connect(self, address):
     self.connected = False
     self.connecting = True
     err = self.socket.connect_ex(address)
     if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \
     or err == EINVAL and os.name in ('nt', 'ce'):
         self.addr = address
         return
     if err in (0, EISCONN):
         self.addr = address
         self.handle_connect_event()
     else:
         raise socket.error(err, errorcode[err])