Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/c2f24dfadce86bb6036eb3ceb9ce05b9 to your computer and use it in GitHub Desktop.
Save zoffixznet/c2f24dfadce86bb6036eb3ceb9ce05b9 to your computer and use it in GitHub Desktop.
my $socket = IO::Socket::INET.new:
localhost => '127.0.0.1',
localport => 12321,
listen => 1;
while $socket.accept -> $conn {
say "Accepted connection";
await start {
say "Started";
while $conn.recv(:2elems) -> $stuff {
say "Recv: $stuff";
}
$conn.close;
}
}
zoffix@VirtualBox:~/CPANPRC$ perl6 test.p6
Accepted connection
Started
Tried to read() on a socket from outside its originating thread
in block <unit> at test.p6 line 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment