code: def _connect(self, sock, addr, timeout):
          
          if self.connection:
              raise SocketClientConnectedError()
  
          if self.connector:
              raise SocketClientConnectingError()
  
          self.connect_deferred = Deferred(self.loop)
          self.sock = sock
          self.addr = addr
          self.connector = Connector(self.loop, sock, addr, timeout)
          self.connector.deferred.add_callback(self._connected)
          self.connector.deferred.add_errback(self._connect_failed)
          self.connector.start()
  
          return self.connect_deferred
docs: Start watching the socket for it to be writtable.