Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Client code doesnt work #33

Open
eiram-sheikh opened this issue Jul 21, 2014 · 0 comments
Open

Client code doesnt work #33

eiram-sheikh opened this issue Jul 21, 2014 · 0 comments

Comments

@eiram-sheikh
Copy link

I have written the following client code for a simple echo server. But it doesnt work as expected. Please let me know the problem in this code.

use strict;
use warnings;
use Protocol::WebSocket::Client;
use IO::Socket::INET;
use Data::Dumper;

my $socket = new IO::Socket::INET (
PeerHost => '192.168.56.101',
PeerPort => '8082',
Proto => 'tcp',
Blocking => 0,
) or die "No connection\n";

my $client = Protocol::WebSocket::Client->new(url => 'ws://192.168.56.101:8082');
$client->on(
write => sub {
my $client = shift;
my ($buf) = @;
print @
;
syswrite $socket, $buf;
}
);

$client->connect;

$client->write('echo');

$client->disconnect;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant