Skip to content

Instantly share code, notes, and snippets.

@lopnor
Created February 1, 2011 02:55
Show Gist options
  • Save lopnor/805329 to your computer and use it in GitHub Desktop.
Save lopnor/805329 to your computer and use it in GitHub Desktop.
#!/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