

def connect(self, callback, close_callback=None):
    'open the connection to the server'
    if (self.status is not status.CLOSED):
        raise AmqpStatusError(('Connection status is %s' % self.status))
    self.status = status.OPENING
    sock = socket.socket()
    sock.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1)
    self.on_connect = callback
    self.on_disconnect = close_callback
    if TORNADO_1_2:
        self.stream = IOStream(sock, io_loop=self.io_loop)
        self.stream.set_close_callback(self.on_closed_stream)
        self.stream.connect((self.host, self.port), self._handshake)
    else:
        sock.connect((self.host, self.port))
        self.stream = IOStream(close_callback, io_loop=self.io_loop)
        self.stream.set_close_callback(self.on_closed_stream)
        self._handshake()

dataset/ETHPy150Open paolo-losi/stormed-amqp/stormed/connection.py Connection.connect/VarMisuse@166/223 `sock`->`close_callback`