标签:发送 host color bsp net main pat recv blog
sub MAIN(Str $host,Str $path, Int $port) {
my $send = "GET $path HTTP/1.1\r\nHost: $host\r\n\r\n";
my $c = IO::Socket::INET.new(:host($host), :port($port));
$c.print: $send;
while (my $buff = $c.recv(1024)) {
say $buff.print;
}
$c.close;
}
标签:发送 host color bsp net main pat recv blog
原文地址:http://www.cnblogs.com/perl6/p/7416272.html