Skip Menu |

This queue is for tickets about the IO-Async CPAN distribution.

Report information
The Basics
Id: 51076
Status: resolved
Priority: 0/
Queue: IO-Async

People
Owner: Nobody in particular
Requestors: W.Sheldon [...] kcs.org.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 0.21
  • 0.22
  • 0.23
  • 0.24
Fixed in: (no value)



Subject: Loop stream issue.
Date: Tue, 3 Nov 2009 15:09:31 -0000
To: <bug-IO-Async [...] rt.cpan.org>
From: "W.Sheldon" <W.Sheldon [...] kcs.org.uk>
Code: my $loop = IO::Async::Loop->new; $loop->listen( service => $LISTEN_PORT, socktype => 'stream', on_accept => \&new_client, on_resolve_error => sub { die "Cannot resolve - $_[0]\n"; }, on_listen_error => sub { die "Cannot listen\n"; }, ); $loop->loop_forever; Causes error on most recent version of GetAddrInfo.pm (0.13): Error: Argument "stream" isn't numeric in subroutine entry at /usr/local/lib/perl/5.10.0/Socket/GetAddrInfo.pm line 304. but works with version GetAddrInfo 0.11 (with /usr/local/share/perl/5.10.0/IO/Async.pm $VERSION = '0.21') Kind regards, Will Sheldon Systems Engineer King's College School DD +44(0)2082555391 Please consider the environment before printing this e-mail. KCS is an International Baccalaureate World School. Registered Charity Number 310024. This Electronic mail is strictly confidential and intended solely for the person or organisation to whom it is addressed. It may contain privileged information and if you are not the intended recipient, you must not copy, distribute or take any action in reliance on it. Its content doesn't necessarily represent the views of this organisation. If you have received it in error, please notify us as soon as possible and delete it. We have an anti-virus system installed on all our PCs and therefore any files leaving us via e-mail will have been checked for known viruses. We accept no responsibility once an e-mail and any attachments leave us. Please be aware that we store all e-mails and may monitor messages at any time.
On Tue Nov 03 10:10:38 2009, W.Sheldon@kcs.org.uk wrote: Show quoted text
> Causes error on most recent version of GetAddrInfo.pm (0.13): > Error: > Argument "stream" isn't numeric in subroutine entry at > /usr/local/lib/perl/5.10.0/Socket/GetAddrInfo.pm line 304. > > but works with version GetAddrInfo 0.11 (with > /usr/local/share/perl/5.10.0/IO/Async.pm $VERSION = '0.21')
Curious. I have confirmed it broken in every version of IO::Async, from 0.21 onwards. One thing I do note is that since Socket::GAI version 0.11, there is now a 'use warnings' (added in 0.12) where previously there wasn't. This probably means you've always had that bug, just that without 'use warnings' the line hasn't printed a warning. Passing 0 as the socktype simply means that getaddrinfo() ought to guess something there - likely the first result is a SOCK_STREAM anyway. This isn't quite guaranteed to work though - I know it fails on Solaris that way. Nevertheless, it's documented it ought to work like that, so I'll add a little shortcut in ->resolve, so it will work in future. -- Paul Evans
Show quoted text
> Nevertheless, it's documented it ought to work like that, so I'll add a > little shortcut in ->resolve, so it will work in future.
I've now added code in the newly-released 0.25 to make it work as documented. Give that some time to shuffle its way through the mirrors, and try it out. -- Paul Evans
(14:58) <woleium> LeoNerd: Just tried 0.25. Works perfectly - tyvm :-) (14:58) <LeoNerd> Marvellous.. can you prod the bug then and close it? (14:59) <LeoNerd> If you don't have an rt.cpan account then you can't, so I'll do it -- Paul Evans