I am using the AnyEvent WebSocket Client with a websocket server set up on Java server Payara. I am using this server for websocket with javascript clients on another use case and everything is working fine.
Here, sending/receiving messages is working fine, but my problem comes from on finish callback which is never called when my server shut down.
my $client = AnyEvent::WebSocket::Client->new;
$client->connect("ws://...")->cb(sub {
our $connection = eval { shift->recv };
if ($@) {
warn $@;
return;
}
$connection->on(each_message => sub {
...
});
$connection->on(finish => sub {
print "Connection finished\n";
});
});
AnyEvent->condvar->recv;
I am using the AnyEvent WebSocket Client with a websocket server set up on Java server Payara. I am using this server for websocket with javascript clients on another use case and everything is working fine.
Here, sending/receiving messages is working fine, but my problem comes from on finish callback which is never called when my server shut down.
Am I doing something wrong here ?