The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Protocol::SocketIO::Message - Socket.IO message parsing and building

SYNOPSIS

# Build messages
$message = Protocol::SocketIO::Message->new(
    type     => 'disconnect',
    endpoint => '/test'
);

$message = Protocol::SocketIO::Message->new(
    type       => 'ack',
    message_id => 4,
    args       => ['A', 'B']
);

# Parse messages
$message = Protocol::SocketIO::Message->new->parse('4:1::{"a":"b"}');

DESCRIPTION

Protocol::SocketIO::Message parsers and builds Socket.IO messages.

METHODS

new

parse

type

is_message

id

data

endpoint

to_bytes

to_string