#NEWLINE# def run( self ) : #NEWLINE# #INDENT# '\n\n        ' #NEWLINE# self . _connect ( ) #NEWLINE# if ( not self . _socket ) : #NEWLINE# #INDENT# LOGGER . warning ( 'Could not connect to %s:%s' , self . _args [ 'host' ] , self . _args [ 'port' ] ) #NEWLINE# return #NEWLINE# #UNINDENT# LOGGER . debug ( 'Socket connected' ) #NEWLINE# local_socket = self . _socket . getsockname ( ) #NEWLINE# peer_socket = self . _socket . getpeername ( ) #NEWLINE# self . _remote_name = ( '%s:%s -> %s:%s' % ( local_socket [ 0 ] , local_socket [ 1 ] , peer_socket [ 0 ] , peer_socket [ 1 ] ) ) #NEWLINE# self . _loop = IOLoop ( self . _socket , self . on_error , self . on_read , self . _write_queue , self . _events , self . _write_listener , self . _exceptions ) #NEWLINE# self . _loop . run ( ) #NEWLINE# if ( ( not self . _exceptions . empty ( ) ) and ( not self . _events . is_set ( events . EXCEPTION_RAISED ) ) ) : #NEWLINE# #INDENT# self . _events . set ( events . EXCEPTION_RAISED ) #NEWLINE# #UNINDENT# LOGGER . debug ( 'Exiting IO.run' )