Skip to content

On finish callback never called #53

@robinvrd

Description

@robinvrd

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;

Am I doing something wrong here ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions