We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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_timeout keep executing even after Handle ->destroy
#! perl use strict; use warnings FATAL => 'all'; use Test::More tests => 2; use AnyEvent::Handle::UDP; use Socket qw/unpack_sockaddr_in/; use IO::Socket::INET; alarm 6; { my $addr = inet_aton('localhost'); socket my $socket, PF_INET, SOCK_DGRAM, 0 or die "Unable to create socket: $!"; connect $socket, pack_sockaddr_in(0, $addr) or die "connect: $!"; my $sockaddr = getsockname $socket; my $client; my $cb = sub { is shift, "TIMEOUT", 'first client timed out'; $client->destroy; }; $client = AnyEvent::Handle::UDP->new( connect => $sockaddr, on_recv => $cb, on_error => $cb, timeout => 1, on_timeout => sub { $cb->("TIMEOUT"); return; }, ); my $cb2 = AE::cv; my $client2 = AnyEvent::Handle::UDP->new( connect => $sockaddr, on_recv => $cb2, on_error => $cb2, timeout => 4, on_timeout => sub { $cb2->("TIMEOUT"); return; }, ); $client->push_send('test'); $client2->push_send('test'); is( $cb2->recv, "TIMEOUT", 'second client timed out' ); }
The text was updated successfully, but these errors were encountered:
Fixed in 0.048
Sorry, something went wrong.
No branches or pull requests
on_timeout keep executing even after Handle ->destroy
The text was updated successfully, but these errors were encountered: