Sockets: Difference between revisions

Content added Content deleted
(Fix UNIX Shell to run 'nc', not 'netcat'. (Some systems only have 'nc'.) Delete redundant UnixPipes example.)
(→‎{{header|Perl 6}}: Add Perl 6 example)
Line 519: Line 519:
$sock->send('hello socket world');
$sock->send('hello socket world');
$sock->free;</lang>
$sock->free;</lang>

=={{header|Perl 6}}==
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';
my $port = 256;

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


=={{header|PHP}}==
=={{header|PHP}}==