Jump to content

Sockets: Difference between revisions

305 bytes added ,  12 years ago
→‎{{header|Perl 6}}: Add Perl 6 example
(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:
$sock->send('hello socket world');
$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}}==
10,351

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.