Net-WebSocket

 view release on metacpan or  search on metacpan

lib/Net/WebSocket/Constants.pm  view on Meta::CPAN

};

use constant {
    PROTOCOL_VERSION => 13,
    REQUIRED_HTTP_METHOD => 'GET',
    REQUIRED_HTTP_STATUS => 101,
    REQUIRED_REQUEST_PROTOCOL => 'HTTP/1.1',
};

#These names are taken from:
#https://msdn.microsoft.com/en-us/library/windows/desktop/hh449350(v=vs.85).aspx
# … however, the up-to-date list of canonical codes is at:
#https://www.iana.org/assignments/websocket/websocket.xml
use constant STATUS => {
    SUCCESS                => 1000,
    ENDPOINT_UNAVAILABLE   => 1001,
    PROTOCOL_ERROR         => 1002,
    INVALID_DATA_TYPE      => 1003,

    #These are never actually sent.
    #EMPTY_CLOSE            => 1005,

lib/Net/WebSocket/Frame/close.pm  view on Meta::CPAN


Returned as the code number and an empty string.

=item * a code, and a reason that cannot exceed 123 bytes

=back

The code (i.e., C<$code>) is subject to
L<the limitations that RFC 6445 describes|https://tools.ietf.org/html/rfc6455#section-7.4>.
You can also, in lieu of a numeric constant, use the following string
constants that derive from L<Microsoft’s WebSocket API|https://msdn.microsoft.com/en-us/library/windows/desktop/hh449350(v=vs.85).aspx>:

=over

=item * C<SUCCESS> (1000)

=item * C<ENDPOINT_UNAVAILABLE> (1001)

=item * C<PROTOCOL_ERROR> (1002)

=item * C<INVALID_DATA_TYPE> (1003)



( run in 0.365 second using v1.01-cache-2.11-cpan-299005ec8e3 )