def on_packet(self, packet_type):
def _wrapper(fn):<EOL><INDENT>return self.callbacks.register(packet_type, fn)<EOL><DEDENT>return _wrapper<EOL>
Registers a function to be called when packet data is received with a
specific type.