Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update socket test for GLR, deprecations.
  • Loading branch information
jnthn committed Sep 4, 2015
1 parent f12a825 commit 18b7541
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions S32-io/IO-Socket-INET.pl
Expand Up @@ -29,7 +29,7 @@
# warn "SERVER ACCEPTED";
my $received = $client.recv();
# warn "SERVER RECEIVED '$received'";
$client.send( $received );
$client.print( $received );
# warn "SERVER REPLIED";
$client.close();
}
Expand All @@ -42,7 +42,7 @@
unlink $server_ready_flag_fn;
my $client = IO::Socket::INET.new(:$host, :$port);
# warn "CLIENT OPENED";
$client.send( [~] '0'..'9', 'a'..'z' );
$client.print( [~] flat '0'..'9', 'a'..'z' );
# warn "CLIENT SENT";
my $received = $client.recv();
# warn "CLIENT RECEIVED '$received'";
Expand Down Expand Up @@ -72,7 +72,7 @@
unlink $server_ready_flag_fn;
my $client = IO::Socket::INET.new(:$host, :$port);
# warn "CLIENT OPENED";
$client.send( [~] '0'..'9', 'a'..'z' );
$client.print( [~] flat '0'..'9', 'a'..'z' );
# warn "CLIENT SENT";
my $received = $client.recv();
# warn "CLIENT RECEIVED '$received'";
Expand All @@ -89,7 +89,7 @@
$fd.close();
while my $client = $server.accept() {
# Also sends two 3 byte unicode characters
$client.send(join '', '0'..'9', 'a'..'z',
$client.print(join '', '0'..'9', 'a'..'z',
chr(0xbeef), chr(0xbabe) );
$client.close();
}
Expand Down Expand Up @@ -123,14 +123,14 @@
$fd.close();
while my $client = $server.accept() {
# default line separator
$client.send("'Twas brillig, and the slithy toves\n");
$client.send("Did gyre and gimble in the wabe;\n");
$client.print("'Twas brillig, and the slithy toves\n");
$client.print("Did gyre and gimble in the wabe;\n");
# custom line separator: \r\n
$client.send("All mimsy were the borogoves,\r\n");
$client.print("All mimsy were the borogoves,\r\n");
# another custom separator: .
$client.send("And the mome raths outgrabe.");
$client.print("And the mome raths outgrabe.");
# separator not at the end of the sent data: !
$client.send("O frabjous day! Callooh! Callay!");
$client.print("O frabjous day! Callooh! Callay!");
$client.close();
}
} else { # client
Expand Down Expand Up @@ -159,7 +159,7 @@
while my $client = $server.accept() {
# send 4 packets á 4096 bytes
for ^4 {
$client.send( $_ x 4096 );
$client.print( $_ x 4096 );
sleep 1;
}
$client.close();
Expand Down Expand Up @@ -235,7 +235,7 @@
$fd.close();
while my $client = $server.accept() {
# send 4 byte string in one packet
$client.send( 'xxxx' );
$client.print( 'xxxx' );
$client.close();
}
}
Expand Down

0 comments on commit 18b7541

Please sign in to comment.