Update of /cvsroot/popfile/engine/Test
In directory sc8-pr-cvs1:/tmp/cvs-serv16506/Test
Modified Files:
SimpleProxy.pm
Log Message:
SimpleProxy chooses a random port
Index: SimpleProxy.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Test/SimpleProxy.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SimpleProxy.pm 13 Jul 2003 04:01:35 -0000 1.2
--- SimpleProxy.pm 17 Jul 2003 20:12:33 -0000 1.3
***************
*** 21,25 ****
# A handy variable containing the value of an EOL for networks
! my $eol = "\015\012";
#----------------------------------------------------------------------------
--- 21,25 ----
# A handy variable containing the value of an EOL for networks
! my $eol = "\n";
#----------------------------------------------------------------------------
***************
*** 43,46 ****
--- 43,48 ----
$self->{received__} = '';
+ $self->{server_port__} = 10000 + int(rand(2000));
+
return $self;
}
***************
*** 55,59 ****
my ( $self ) = @_;
! close $self->{remote_server__};
}
--- 57,61 ----
my ( $self ) = @_;
! close $self->{remote_server__} if ( defined( $self->{remote_server__} ) );
}
***************
*** 74,78 ****
$self->{remote_server__} = IO::Socket::INET->new( Proto => 'tcp',
LocalAddr => 'localhost',
! LocalPort => 10000,
Listen => SOMAXCONN,
Reuse => 1 );
--- 76,80 ----
$self->{remote_server__} = IO::Socket::INET->new( Proto => 'tcp',
LocalAddr => 'localhost',
! LocalPort => $self->{server_port__},
Listen => SOMAXCONN,
Reuse => 1 );
***************
*** 102,107 ****
# If there's data in the send pipe then write it out line by line
! while ( $self->{send__} =~ s/(.+)[\r\n]+// ) {
$self->tee_( $handle, "$1$eol" );
}
--- 104,110 ----
# If there's data in the send pipe then write it out line by line
! while ( $self->{send__} =~ s/^([^\r\n]+)[\r\n]+// ) {
$self->tee_( $handle, "$1$eol" );
+ select( undef, undef, undef, 0.1 );
}
***************
*** 146,150 ****
# Connect to the simple server that
! my $remote = $self->verify_connected_( 0, $client, 'localhost', 10000 );
if ( defined( $remote ) && $remote->connected ) {
--- 149,153 ----
# Connect to the simple server that
! my $remote = $self->verify_connected_( 0, $client, 'localhost', $self->{server_port__} );
if ( defined( $remote ) && $remote->connected ) {
***************
*** 189,192 ****
--- 192,197 ----
my $received = $self->{received__};
+
+ $self->log_( "Received $received" );
$self->{received__} = '';
|