def on_message(self, new_data):
<EOL>LOGGER.debug("<STR_LIT>", new_data)<EOL>try:<EOL><INDENT>what = int(new_data[<NUM_LIT:0>])<EOL>data = new_data[<NUM_LIT:1>:]<EOL>data = data and from_json(data)<EOL>if what == <NUM_LIT:0>:<EOL><INDENT>self.ping_interval = float(data["<STR_LIT>"]) / <NUM_LIT:1000><EOL>LOGGER.debug("<STR_LIT>")<EOL>return<EOL><DEDENT>if what == <NUM_LIT:1>:<EOL><INDENT>LOGGER.debug("<STR_LIT>")<EOL>self.reraise(IOError("<STR_LIT>"))<EOL>return<EOL><DEDENT>if what == <NUM_LIT:3>:<EOL><INDENT>self.__lastpong = time.time()<EOL>LOGGER.debug("<STR_LIT>")<EOL>return<EOL><DEDENT>if what == <NUM_LIT:4>:<EOL><INDENT>self._on_frame(data)<EOL>return<EOL><DEDENT>if what == <NUM_LIT:6>:<EOL><INDENT>LOGGER.debug("<STR_LIT>")<EOL>self.send_message("<STR_LIT:5>")<EOL>return<EOL><DEDENT>LOGGER.debug("<STR_LIT>", what, data)<EOL><DEDENT>except Exception as ex:<EOL><INDENT>self.reraise(ex)<EOL><DEDENT>
Processes incoming messages according to engine-io rules