in reply to AnyEvent:WebSocket produces 'No such device or address' error

AnyEvent::Socket::tcp_connect likely only wants a hostname or an IP address, not an URI.

Maybe you can try the following:

AnyEvent::Socket::tcp_connect 'mydomain.com', 80, sub { my $fh = shift; unless($fh) { $done->croak("unable to connect to ".$uri->as_string." $!"); return; }

This is somewhat the first step, because AnyEvent::Socket doesn't speak whatever protocol websockets layer on top of TCP.

Replies are listed 'Best First'.
Re^2: AnyEvent:WebSocket produces 'No such device or address' error
by meep (Initiate) on Mar 27, 2017 at 16:51 UTC
    Thanks for the response. On foot of your suggestion, I've tried multiple hardcoded variants of the hostname and raw IP address there instead of the passed-in URI but to no avail.

      Maybe you can reduce your code to a short, self-contained example that we can use to reproduce your problem.

      I'm not sure where in the layers upon layers of protocol modules the problem lies, so something, maybe using AnyEvent::WebSocket that tries to access a public accessible websocket machine can help us see better what happens.