PocketIO::Client::IO - simple pocketio client
use PocketIO::Client::IO; my $socket = PocketIO::Client::IO->connect("http://localhost:3000/"); # $socket is a PocketIO::Socket object. my $cv = AnyEvent->condvar; my $w = AnyEvent->timer( after => 5, cb => $cv ); $socket->on( 'message', sub { say $_[1]; } ); $socket->on( 'connect', sub { $socket->send('Parumon!'); $socket->emit('hello', "perl"); } ); $cv->wait;
Simple Socket.IO client using AnyEvent::PocketIO::Client.
This is beta version. APIs will be changed.
Currently acceptable transport id is websocket only.
If you want to controll client action more detail, please see to AnyEvent::PocketIO::Client.
$socket = PocketIO::Client::IO->connect( $url );
Handshakes and connects to $url, then returns a PocketIO::Socket::ForClient object which inherits PocketIO::Socket.
$url
PocketIO::Socket::ForClient
AnyEvent::PocketIO::Client, PocketIO, PcketIO::Socket
Makamaka Hannyaharamitu, <makamaka[at]cpan.org>
Copyright 2012 by Makamaka Hannyaharamitu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install PocketIO::Client::IO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PocketIO::Client::IO
CPAN shell
perl -MCPAN -e shell install PocketIO::Client::IO
For more information on module installation, please visit the detailed CPAN module installation guide.