Sockets: Difference between revisions

Content added Content deleted
m (→‎{{header|Perl 6}}: .send obsolete, now .print)
Line 665: Line 665:


=={{header|Perl 6}}==
=={{header|Perl 6}}==
{{Works with|rakudo|2016.03}}
Will fail with a connect error if there is not a socket server of some kind available on the specified host and port.
Will fail with a connect error if there is not a socket server of some kind available on the specified host and port.
<lang perl6>my $host = '127.0.0.1';
<lang perl6>my $host = '127.0.0.1';
Line 670: Line 671:


my $client = IO::Socket::INET.new(:$host, :$port);
my $client = IO::Socket::INET.new(:$host, :$port);
$client.send( 'hello socket world' );
$client.print( 'hello socket world' );
$client.close;</lang>
$client.close;</lang>