#NEWLINE# def connect( self ) : #NEWLINE# #INDENT# 'Connect using saved connection parameters\n\n        This method does not need to be called explicitly; it is called by\n        the constructor during initialization.\n\n        Note: reconnecting invalidates all declarations (channels, queues,\n        consumers, delivery tags, etc.).\n        ' #NEWLINE# self . connection = self #NEWLINE# self . transport = create_transport ( self . _host , self . _port , self . _connect_timeout , self . frame_max , self . _ssl ) #NEWLINE# self . method_reader = MethodReader ( self . transport ) #NEWLINE# self . method_writer = MethodWriter ( self . transport , self . frame_max ) #NEWLINE# self . wait ( spec . Connection . Start ) #NEWLINE# login_response = AMQPWriter ( ) #NEWLINE# login_response . write_table ( { #NEWLINE# #INDENT# 'LOGIN' : self . _userid , #NEWLINE# 'PASSWORD' : self . _password , #NEWLINE# #UNINDENT# } ) #NEWLINE# login_response = login_response . getvalue ( ) [ 4 : ] #NEWLINE# client_props = dict ( LIBRARY_PROPERTIES , ** ( self . _client_properties or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . _send_start_ok ( client_props , self . _login_method , login_response , self . _locale ) #NEWLINE# self . _wait_tune_ok = True #NEWLINE# while self . _wait_tune_ok : #NEWLINE# #INDENT# self . wait_any ( [ spec . Connection . Secure , spec . Connection . Tune ] ) #NEWLINE# #UNINDENT# self . _send_open ( self . _virtual_host ) #NEWLINE# if self . _heartbeat_final : #NEWLINE# #INDENT# self . _close_event . clear ( ) #NEWLINE# log . debug ( 'Start automatic heartbeat thread' ) #NEWLINE# thr = Thread ( target = self . _heartbeat_run , name = ( 'amqp-HeartBeatThread-%s' % id ( self ) ) ) #NEWLINE# thr . daemon = True #NEWLINE# thr . start ( ) #NEWLINE# self . _heartbeat_thread = login_response