Paul Evans > Net-Async-WebSocket-0.08 > Net::Async::WebSocket::Protocol

Download:
Net-Async-WebSocket-0.08.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  3
View/Report Bugs
Module Version: 0.08   Source  

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>

syntax highlighting: