<s> import zmq <EOL> class BotConnection : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , endpoint , secret_key ) : <EOL> self . endpoint = endpoint <EOL> self . secret_key = str ( secret_key ) <EOL> self . context = zmq . Context ( <NUM_LIT:1> ) <EOL> def connect ( self ) : <EOL> self . client = self . context . socket ( zmq . REQ ) <EOL> self . client . connect ( self . endpoint ) <EOL> self . poll = zmq . Poller ( ) <EOL> self . poll . register ( self . client , zmq . POLLIN ) <EOL> def disconnect ( self ) : <EOL> self . client . setsockopt ( zmq . LINGER , <NUM_LIT:0> ) <EOL> self . client . close ( ) <EOL> self . poll . unregister ( self . client ) <EOL> def reconnect ( self ) : <EOL> self . disconnect ( ) <EOL> self . connect ( ) <EOL> def close ( self ) : <EOL> self . disconnect ( ) <EOL> self . context . term ( ) </s>
