The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Async::WebSocket::Protocol - send and receive WebSocket frames

DESCRIPTION

This subclass of IO::Async::Stream implements an established WebSocket connection, that has already completed its setup handshaking and is ready to pass frames.

Objects of this type would not normally be constructed directly. For WebSocket clients, see Net::Async::WebSocket::Client, which is a subclass of this. For WebSocket servers, see Net::Async::WebSocket::Server, which constructs objects in this class when it accepts a new connection and passes it to its event handler.

PARAMETERS

The following named parameters may be passed to new or configure:

on_frame => CODE

A CODE reference for when a frame is received

 $on_frame->( $self, $frame )

METHODS

$self->send_frame( @args )

Sends a frame to the peer containing containing the given string. The arguments are passed to Protocol::WebSocket::Frame's new method.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>