def connect(self):
distributed_logger.info('<STR_LIT>', self.socket_addr)<EOL>self.zmq_context = zmq.Context()<EOL>sock = self.zmq_context.socket(zmq.PUB)<EOL>sock.set_hwm(<NUM_LIT:0>)<EOL>sock.setsockopt(zmq.LINGER, <NUM_LIT:0>)<EOL>sock.connect(self.socket_addr)<EOL>distributed_logger.info('<STR_LIT>', self.socket_addr)<EOL>def _reset_socket(values):<EOL><INDENT>for value in values:<EOL><INDENT>try:<EOL><INDENT>_reset_socket(value.values())<EOL><DEDENT>except AttributeError:<EOL><INDENT>value.socket = sock<EOL><DEDENT><DEDENT><DEDENT>distributed_logger.debug('<STR_LIT>')<EOL>_reset_socket(self.stats.values())<EOL>self.socket = sock<EOL>distributed_logger.debug('<STR_LIT>')<EOL>
Connects to the 0MQ socket and starts publishing.