How to use the imjoy.engineio_client.parser.Packet 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 / engineio_client / client.py View on Github external
def on_pause():
            self.set_transport(transport)
            self.transport.send([Packet(Packet.UPGRADE, '')])
            self.transport_ready_event.set()
github oeway / ImJoy-Engine / imjoy / engineio_client / transports / websocket.py View on Github external
def close():
            self.send([Packet(Packet.CLOSE)])
            self.client.stop_loop(self.read_loop)
github oeway / ImJoy-Engine / imjoy / engineio_client / client.py View on Github external
def on_transport_open():
            transport.send([Packet(Packet.PING, 'probe')])
            transport.once('packet', on_packet)
github oeway / ImJoy-Engine / imjoy / engineio_client / client.py View on Github external
def send(self, message, binary=False):
        self.send_packet(Packet(Packet.MESSAGE, message, binary))
github oeway / ImJoy-Engine / imjoy / engineio_client / parser.py View on Github external
elif packet_type >= 48:
            packet_type -= 48
            binary = False
        else:
            binary = True
        packet_data = None
        if len(encoded_packet) > 1:
            if binary:
                if b64:
                    packet_data = base64.b64decode(encoded_packet[1:])
                else:
                    packet_data = encoded_packet[1:]
            else:
                packet_data = encoded_packet[1:].decode('utf-8')

        return Packet(packet_type, packet_data, binary)