Created
June 11, 2017 01:36
-
-
Save bioduds/01b17be1585fba3b8c16772b0af6ae23 to your computer and use it in GitHub Desktop.
trying these
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::Async.bind-udp('localhost', 5000); | |
react { | |
whenever $socket.Supply -> $v { | |
if $v.chars > 0 { | |
say $v; | |
} | |
} | |
} | |
# await IO::Socket::Async.connect('localhost', 5000).then( -> $p { | |
# if $p.status { | |
# given $p.result { | |
# .print('Hello, Perl 6'); | |
# react { | |
# whenever .Supply() -> $v { | |
# $v.say; | |
# done; | |
# } | |
# } | |
# .close; | |
# } | |
# } | |
# }); | |
# my $listen = IO::Socket::INET.new(:listen, :localhost<localhost>, :localport(5000)); | |
# | |
# loop { | |
# my $conn = $listen.accept; | |
# while my $buf = $conn.recv(:bin) { | |
# $conn.write: $buf; | |
# } | |
# $conn.close; | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment