Echo server: Difference between revisions

Content added Content deleted
(updated)
m (→‎{{header|Perl 6}}: send now print)
Line 1,371: Line 1,371:
By default it spawns 5 child processes at startup, makes sure there are always at least 2 and at most 10 spare children available for new requests, each of which will be killed after processing 1000 requests and new ones will take their place.
By default it spawns 5 child processes at startup, makes sure there are always at least 2 and at most 10 spare children available for new requests, each of which will be killed after processing 1000 requests and new ones will take their place.
=={{header|Perl 6}}==
=={{header|Perl 6}}==
{{works with|rakudo|2015-09-09}}
{{Works with|rakudo|2016-03}}
<lang perl6>my $socket = IO::Socket::INET.new:
<lang perl6>my $socket = IO::Socket::INET.new:
localhost => 'localhost',
localhost => 'localhost',
Line 1,382: Line 1,382:
while $conn.recv -> $stuff {
while $conn.recv -> $stuff {
say "Echoing $stuff";
say "Echoing $stuff";
$conn.send($stuff);
$conn.print($stuff);
}
}
$conn.close;
$conn.close;