Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub async($fn) {
- Thread.start($fn);
- say "started";
- }
- my $socket = IO::Socket::INET.new:
- localhost => 'localhost',
- localport => 12321,
- listen => 1;
- while $socket.accept -> $conn {
- say "Accepted connection";
- async {
- say "got in here";
- while $conn.recv -> $stuff {
- say "Echoing $stuff";
- $conn.send($stuff);
- }
- $conn.close;
- say "closed";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment