Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Prepare for new CPAN release, 0.07

* Clarify behaviour of LocalPort when it's missing
  • Loading branch information...
commit 10efba3a8096d56b73e8fd6222efa3b7ac05e5d6 1 parent c538121
@cosimo authored
Showing with 8 additions and 2 deletions.
  1. +1 −1  dist.ini
  2. +3 −1 t/MockServer.pm
  3. +4 −0 t/mock-server.t
View
2  dist.ini
@@ -4,7 +4,7 @@ license = Perl_5
copyright_holder = Cosimo Streppone
copyright_year = 2012
-version = 0.06
+version = 0.07
[@Basic]
[PkgVersion]
View
4 t/MockServer.pm
@@ -8,11 +8,13 @@ $| = 1;
use vars qw ($socket @messages $select);
sub start {
+
+ # No LocalPort means use any available unprivileged port
$socket = new IO::Socket::INET(
LocalAddr => '127.0.0.1',
Proto => 'udp',
) or die "unable to create socket: $!\n";
-
+
$select = IO::Select->new($socket);
reset_messages();
return $socket->sockport();
View
4 t/mock-server.t
@@ -39,7 +39,11 @@ by validating the udp messages sent to a mock server
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
DESCRIPTION
+# Mock server will start on any available unprivileged port
$Net::Statsd::PORT = MockServer::start();
+
+note "Mock server started on localhost:${Net::Statsd::PORT}";
+
my $msgs;
Net::Statsd::timing('test.timer', 345);
Please sign in to comment.
Something went wrong with that request. Please try again.