How to use the imjoy.imjoySocketIO_client.exceptions.PacketError function in imjoy

To help you get started, we’ve selected a few imjoy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oeway / ImJoy-Engine / imjoy / imjoySocketIO_client / __init__.py View on Github external
def get_namespace(self, path=""):
        try:
            return self._namespace_by_path[path]
        except KeyError:
            raise PacketError("undefined socket.io namespace (%s)" % path)
github oeway / ImJoy-Engine / imjoy / imjoySocketIO_client / __init__.py View on Github external
def get_namespace(self):
        try:
            return self._namespace
        except AttributeError:
            raise PacketError("undefined engine.io namespace")
github oeway / ImJoy-Engine / imjoy / imjoySocketIO_client / __init__.py View on Github external
def _on_event(self, packet):
        args = packet.args
        try:
            event = args.pop(0)
        except IndexError:
            raise PacketError("missing event name")
        if packet.ack_id is not None:
            args.append(self._prepare_to_send_ack(packet.path, packet.ack_id))
        packet.namespace._find_packet_callback(event)(*args)
github oeway / ImJoy-Engine / imjoy / imjoySocketIO_client / __init__.py View on Github external
def _process_packets(self):
        for engineIO_packet in self._transport.recv_packet():
            try:
                self._process_packet(engineIO_packet)
            except PacketError as e:
                self._warn("[packet error] %s", e)