#NEWLINE# def run( self ) : #NEWLINE# #INDENT# ( self . conn , _ ) = self . s . accept ( ) #NEWLINE# while self . running : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# _ = self . conn . recv ( 1024 ) #NEWLINE# frame = self . get_next_frame ( ) #NEWLINE# if ( self . conn is None ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# if ( frame is not None ) : #NEWLINE# #INDENT# self . conn . send ( encode ( frame ) ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception : #NEWLINE# #INDENT# ( _ , e , _ ) = sys . exc_info ( ) #NEWLINE# log . debug ( self ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# self . conn . close ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# self . stopped = True #NEWLINE# log . debug ( 'Run loop completed' )