NAME
PocketIO::Client::IO - simple pocketio client
SYNOPSIS
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;
DESCRIPTION
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.
METHODS
connect
$socket = PocketIO::Client::IO->connect( $url );
Handshakes and connects to $url
, then returns a PocketIO::Socket::ForClient
object which inherits PocketIO::Socket.
SEE ALSO
AnyEvent::PocketIO::Client, PocketIO, PcketIO::Socket
AUTHOR
Makamaka Hannyaharamitu, <makamaka[at]cpan.org>
COPYRIGHT AND LICENSE
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.