def _socket_connect(self):
        """create a socket, connect, register a stream with the async backend"""
        self.usage_count = 0
        try:
            s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
            s.connect((self._host, self._port))
            self.__stream = self.__backend.register_stream(s, **self.__kwargs)
            self.__stream.set_close_callback(self._socket_close)
            self.__alive = True
        except socket.error, error:
            raise InterfaceError(error)
def _socket_connect ( self ) : self . usage_count = 0 try : s = socket . socket ( socket . AF_INET , socket . SOCK_STREAM , 0 ) s . connect ( ( self . _host , self . _port ) ) self . __stream = self . __backend . register_stream ( s , ** self . __kwargs ) self . __stream . set_close_callback ( self . _socket_close ) self . __alive = True except socket . error , error : raise InterfaceError ( error )
create a socket, connect, register a stream with the async backend