Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Echo-server/Raku/echo-server-1.raku
Normal file
15
Task/Echo-server/Raku/echo-server-1.raku
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
my $socket = IO::Socket::INET.new:
|
||||
:localhost<localhost>,
|
||||
:localport<12321>,
|
||||
:listen;
|
||||
|
||||
while $socket.accept -> $conn {
|
||||
say "Accepted connection";
|
||||
start {
|
||||
while $conn.recv -> $stuff {
|
||||
say "Echoing $stuff";
|
||||
$conn.print($stuff);
|
||||
}
|
||||
$conn.close;
|
||||
}
|
||||
}
|
||||
7
Task/Echo-server/Raku/echo-server-2.raku
Normal file
7
Task/Echo-server/Raku/echo-server-2.raku
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
react {
|
||||
whenever IO::Socket::Async.listen('0.0.0.0', 12321) -> $conn {
|
||||
whenever $conn.Supply.lines -> $line {
|
||||
$conn.print( "$line\n" ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue