#NEWLINE# def onMessage( self , msg , binary ) : #NEWLINE# #INDENT# ' Method is called by the Autobahn engine when a message has been\n            received from the client.\n\n            @param msg:         Message which was received as a string.\n            @type  msg:         str\n\n            @param binary:      Flag which is True if the message has binary\n                                format and False otherwise.\n            @type  binary:      bool\n        ' #NEWLINE# try : #NEWLINE# #INDENT# self . _assembler . processMessage ( msg , binary ) #NEWLINE# #UNINDENT# except InvalidRequest as e : #NEWLINE# #INDENT# self . sendErrorMessage ( 'Invalid Request: {0}' . format ( self ) ) #NEWLINE# #UNINDENT# except DeadConnection : #NEWLINE# #INDENT# self . sendErrorMessage ( 'Dead Connection' ) #NEWLINE# self . dropConnection ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# import traceback #NEWLINE# traceback . print_exc ( ) #NEWLINE# self . sendErrorMessage ( 'Fatal Error' )