Subject: | Handshake failed |
Date: | Tue, 19 Nov 2013 15:38:35 +0000 |
To: | bug-AnyEvent-MtGox-Stream [...] rt.cpan.org |
From: | Paul Webster <paul.g.webster [...] googlemail.com> |
Hi there I am trying to recieve data from the MtGox API I tried your
example in ex/
But it seems to consistently fail handshaking..
paul@container:~/bots % perl t
Socket.IO handshake failed at
/home/paul/perl5/lib/perl5/AnyEvent/MtGox/Stream.pm line 36
2013-11-19 15:36:02.207442 +0000 error AnyEvent::Util: Runtime error
in AnyEvent::guard callback: Can't call method "destroy" on an
undefined value at /home/paul/perl5/lib/perl5/AnyEvent/MtGox/Stream.pm
line 111.
paul@container:~/bots % cat t
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent;
use AnyEvent::MtGox::Stream;
use Carp qw(croak);
use Data::Dump;
my $timeout = shift || 0;
binmode STDOUT, ':encoding(utf-8)';
my $cv = AE::cv;
my $client = AnyEvent::MtGox::Stream->new(
# secure => 1,
on_error => sub { croak(@_) },
on_disconnect => sub { croak("Disconnected") },
on_message => sub { warn $_[0];dd(shift) },
);
my $timer = AE::timer $timeout, 0, sub { undef $client; $cv->send }
if $timeout;
$cv->recv;