#NEWLINE# def add_to_loop( self , loop ) : #NEWLINE# #INDENT# if self . _eventloop : #NEWLINE# #INDENT# raise Exception ( 'already add to loop' ) #NEWLINE# #UNINDENT# if self . _closed : #NEWLINE# #INDENT# raise Exception ( 'already closed' ) #NEWLINE# #UNINDENT# self . _eventloop = loop #NEWLINE# loop . add_handler ( self . _handle_events ) #NEWLINE# self . _eventloop . add ( self . socket , ( eventloop . POLL_IN | eventloop . POLL_ERR ) )