Created
July 5, 2016 10:45
-
-
Save zoffixznet/c2f24dfadce86bb6036eb3ceb9ce05b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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