Created
February 1, 2011 02:55
-
-
Save lopnor/805329 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
#!/usr/bin/env perl6 | |
use v6; | |
my $sock = IO::Socket::INET.socket(2,1,6); | |
my $attr = $sock.^attributes(:local).grep({.name eq '$!PIO'})[0]; | |
my $pio = $attr.get_value($sock); | |
my $addr = $pio.sockaddr('127.0.0.1', 5000); | |
$pio.connect($addr); | |
#$sock.open('127.0.0.1', 5000, :bin); | |
$pio.send('foobar'); | |
#$sock.send("foobar\r\n"); | |
#my $res = $sock.recv(); | |
my $res = $pio.recv(); | |
$sock.close; | |
say $res.perl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment