def connect(self):
        if self.state not in (INIT, DISCONNECTED):
            return

        stream = Stream(self.address, self.tcp_port, self.timeout)
        stream.connect()

        self.stream = stream
        self.state = CONNECTED
        self.send(nsq.MAGIC_V2)
Initialize connection to the nsqd.
dataset/ETHPy150Open wtolson/gnsq/gnsq/nsqd.py/Nsqd.connect