Skip to content

IO::Select can't remove closed socket [rt.cpan.org #77740] #17447

@toddr

Description

@toddr

Migrated from rt.cpan.org#77740 (status was 'open')

Requestors:

Attachments:

From bitcard@stormcloud9.net on 2012-06-09 23:13:45:
If an IO::Socket handle is closed before removing it from the IO::Select object, IO::Select is unable to remove it.

use IO::Socket;
use IO::Select;
my $sock = IO::Socket::INET->new('PeerAddr' => 'google.com', 'PeerPort' 
=> 80, 'Proto' => 'tcp');
my $ios = IO::Select->new();
$ios->add($sock);
close($sock);
print("Removing handle $sock\n");
$ios->remove($sock); # <-- this does not work
print("Remaining handles: " . join(" ", $ios->handles()) . "\n");

From leonerd-cpan@leonerd.org.uk on 2014-02-20 18:28:43:

Attached patch fixes this.

--

Paul Evans

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugdist-IOissues in the dual-life blead-first IO distribution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions