AnyEvent-WebSocket-Client

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

     my $cv = $client->connect($uri, $host, $port);

    Open a connection to the web server and open a WebSocket to the
    resource defined by the given URL. The URL may be either an instance of
    URI::ws, URI::wss, or a string that represents a legal WebSocket URL.

    You can override the connection host and port by passing them in as the
    second and third argument. These values (if provided) are passed
    directly into AnyEvent::Socket's tcp_connect function, so please note
    that function's idiosyncrasies in the AnyEvent::Socket documentation.
    In particular, you can pass in unix/ as the host and a filesystem path
    as the "port" to connect to a unix domain socket.

    This method will return an AnyEvent condition variable which you can
    attach a callback to. The value sent through the condition variable
    will be either an instance of AnyEvent::WebSocket::Connection or a
    croak message indicating a failure. The synopsis above shows how to
    catch such errors using eval.

FAQ

 My program exits before doing anything, what is up with that?

lib/AnyEvent/WebSocket/Client.pm  view on Meta::CPAN

 my $cv = $client->connect($uri, $host, $port);

Open a connection to the web server and open a WebSocket to the resource
defined by the given URL.  The URL may be either an instance of L<URI::ws>,
L<URI::wss>, or a string that represents a legal WebSocket URL.

You can  override the connection host and port by passing them in as the
second and third argument.  These values (if provided) are passed directly
into L<AnyEvent::Socket>'s C<tcp_connect> function, so please note that
function's idiosyncrasies in the L<AnyEvent::Socket> documentation.  In
particular,  you can pass in C<unix/> as the host and a filesystem path
as the "port" to connect to a unix domain socket.

This method will return an L<AnyEvent> condition variable which you can
attach a callback to.  The value sent through the condition variable will
be either an instance of L<AnyEvent::WebSocket::Connection> or a croak
message indicating a failure.  The synopsis above shows how to catch
such errors using C<eval>.

=head1 FAQ

=head2 My program exits before doing anything, what is up with that?



( run in 0.844 second using v1.01-cache-2.11-cpan-39bf76dae61 )