Advertisement
Guest User

Untitled

a guest
Oct 14th, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.29 KB | None | 0 0
  1. my $socket = IO::Socket::INET.new:
  2.     localhost => 'localhost',
  3.     localport => 12321,
  4.     listen => 10,
  5.     blocking => 0;
  6.  
  7. while $socket.accept -> $conn {
  8.     say "Accepted connection";
  9.     do {
  10.         while $conn.recv -> $stuff {
  11.             say "Echoing $stuff";
  12.             $conn.send($stuff);
  13.         }
  14.         $conn.close;
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement