Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 47854
Status: resolved
Worked: 15 min
Priority: 0/
Queue: POE

People
Owner: BINGOS [...] cpan.org
Requestors: mlf-bitcard [...] shoebox.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.006
Fixed in: (no value)



Subject: POE::Component::Server::TCP - Port does not default
The documentation says Port defaults to INADDR_ANY. In fact Port doesn't default at all; if Port isn't specified the constructor dies. In addition, INADDR_ANY doesn't actually work (judging from my testing). 0, however, does, as evidenced by a few regression tests in the test suite. Therefore I've attached a patch; it defaults Port to 0 if it isn't specified, and updates the documentation to reflect this.
Subject: default-port-to-0.patch
--- TCP.pm-orig 2009-07-13 19:53:08.000000000 -0800 +++ TCP.pm-mod 2009-07-13 20:06:41.000000000 -0800 @@ -36,9 +36,6 @@ croak "$mi requires an even number of parameters" if (@_ & 1); my %param = @_; - # Validate what we're given. - croak "$mi needs a Port parameter" unless exists $param{Port}; - # Extract parameters. my $alias = delete $param{Alias}; my $address = delete $param{Address}; @@ -47,6 +44,8 @@ my $domain = delete($param{Domain}) || AF_INET; my $concurrency = delete $param{Concurrency}; + $port = 0 unless defined $port; + foreach ( qw( Acceptor Error ClientInput ClientConnected ClientDisconnected @@ -950,7 +949,7 @@ =head4 Port C<Port> contains the port the listening socket will be bound to. It -defaults to INADDR_ANY, which usually lets the operating system pick a +defaults to 0, which usually lets the operating system pick a port at random. Port => 30023
Subject: Re: [rt.cpan.org #47854] POE::Component::Server::TCP - Port does not default
Date: Fri, 17 Jul 2009 08:53:49 +0100
To: Michael Fowler via RT <bug-POE [...] rt.cpan.org>
From: "Chris 'BinGOs' Williams" <chris [...] bingosnet.co.uk>
On Tue, Jul 14, 2009 at 12:10:25AM -0400, Michael Fowler via RT wrote: Show quoted text
> Tue Jul 14 00:10:17 2009: Request 47854 was acted upon. > Transaction: Ticket created by mlfowler > Queue: POE > Subject: POE::Component::Server::TCP - Port does not default > Broken in: 1.006 > Severity: Normal > Owner: Nobody > Requestors: mlf-bitcard@shoebox.net > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=47854 > > > > The documentation says Port defaults to INADDR_ANY. In fact Port > doesn't default at all; if Port isn't specified the constructor dies. > > In addition, INADDR_ANY doesn't actually work (judging from my testing). > 0, however, does, as evidenced by a few regression tests in the test > suite. Therefore I've attached a patch; it defaults Port to 0 if it > isn't specified, and updates the documentation to reflect this.
Thanks applied to repo as r2569 http://github.com/bingos/poe/commit/9eb02e099f83dab210f7fdd8ad313e4f2786221f -- Chris Williams aka BinGOs PGP ID 0x4658671F http://www.gumbynet.org.uk ==========================
Download (untitled)
application/pgp-signature 189b

Message body not shown because it is not plain text.

Closing ticket.