"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Kernel/cpan-lib/Selenium/CanStartBinary/ProbePort.pm" between
otrs-5.0.39.tar.bz2 and otrs-5.0.40.tar.bz2

About: OTRS (formerly "Open Ticket Request System" now "Open Technology – Real Service") is a web-based ticketing systems used for Customer Service, Help Desk, IT Service Management. 5.x release ("Community Edition").

ProbePort.pm  (otrs-5.0.39.tar.bz2):ProbePort.pm  (otrs-5.0.40.tar.bz2)
package Selenium::CanStartBinary::ProbePort; package Selenium::CanStartBinary::ProbePort;
$Selenium::CanStartBinary::ProbePort::VERSION = '1.33'; $Selenium::CanStartBinary::ProbePort::VERSION = '1.36';
use strict; use strict;
use warnings; use warnings;
# ABSTRACT: Utility functions for finding open ports to eventually bind to # ABSTRACT: Utility functions for finding open ports to eventually bind to
use IO::Socket::INET; use IO::Socket::INET;
use Selenium::Waiter qw/wait_until/; use Selenium::Waiter qw/wait_until/;
require Exporter; require Exporter;
our @ISA = qw/Exporter/; our @ISA = qw/Exporter/;
our @EXPORT_OK = qw/find_open_port_above find_open_port probe_port/; our @EXPORT_OK = qw/find_open_port_above find_open_port probe_port/;
sub find_open_port_above { sub find_open_port_above {
my ($port) = @_; socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname("tcp"));
bind(SOCK, sockaddr_in(0, INADDR_ANY));
my $free_port = wait_until { my $port = (sockaddr_in(getsockname(SOCK)))[0];
if ( probe_port($port) ) { close(SOCK);
$port++; return $port;
return 0;
}
else {
return $port;
}
};
return $free_port;
} }
sub find_open_port { sub find_open_port {
my ($port) = @_; my ($port) = @_;
probe_port($port) ? return 0 : return $port; probe_port($port) ? return 0 : return $port;
} }
sub probe_port { sub probe_port {
my ($port) = @_; my ($port) = @_;
skipping to change at line 59 skipping to change at line 51
=pod =pod
=encoding UTF-8 =encoding UTF-8
=head1 NAME =head1 NAME
Selenium::CanStartBinary::ProbePort - Utility functions for finding open ports t o eventually bind to Selenium::CanStartBinary::ProbePort - Utility functions for finding open ports t o eventually bind to
=head1 VERSION =head1 VERSION
version 1.33 version 1.36
=for Pod::Coverage *EVERYTHING* =for Pod::Coverage *EVERYTHING*
=head1 SEE ALSO =head1 SEE ALSO
Please see those modules/websites for more information related to this module. Please see those modules/websites for more information related to this module.
=over 4 =over 4
=item * =item *
 End of changes. 3 change blocks. 
15 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)