<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _connected(self, sock):
 """When the socket is writtable, the socket is ready to be used."""

        logger.debug('socket connected, building protocol')
        self.protocol = self.factory.build(self.loop)
        self.connection = Connection(self.loop, self.sock, self.addr,
            self.protocol, self) 
        self.connector = None
        self.connect_deferred.callback(self.protocol)