code: def on_connect(self, connection):
          
          self._sock = connection._sock
          self._buffer = SocketBuffer(self._sock, self.socket_read_size)        
          if connection.decode_responses:
              self.encoding = connection.encoding
docs: Called when the socket connects