class SocketIoSocket extends Emitter {

    void onEvent(final Packet packet) {
        Object[] args = (packet.data != null)? unpackEventData((JSONArray)packet.data) : EMPTY_ARGS;

        if (packet.id >= 0) {
            final Object[] emitArgs = new Object[args.length + 1];
            System.arraycopy(args, 0, emitArgs, 0, args.length);
            emitArgs[args.length] = (ReceivedByLocalAcknowledgementCallback) args1 -> {
                final Packet ackPacket = PacketUtils.createDataPacket(Parser.ACK, null, args1);
                ackPacket.id = packet.id;
                sendPacket(ackPacket);
            };
            args = emitArgs;
        }

        final String event = args[0].toString();
        final Object[] eventArgs = new Object[args.length - 1];
        System.arraycopy(args, 1, eventArgs, 0, eventArgs.length);

        emit(event, eventArgs);
        for (AllEventListener listener : mAllEventListeners) {
            listener.event(event, eventArgs);
        }
    }

      SocketIoSocket(SocketIoNamespaceImpl namespace, SocketIoClient client);

}