Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On finish callback never called #53

Open
robinvrd opened this issue Sep 1, 2020 · 0 comments
Open

On finish callback never called #53

robinvrd opened this issue Sep 1, 2020 · 0 comments

Comments

@robinvrd
Copy link

robinvrd commented Sep 1, 2020

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 ?

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

No branches or pull requests

1 participant