Jump to content

Sockets: Difference between revisions

5 bytes removed ,  12 years ago
Fix UNIX Shell to run 'nc', not 'netcat'. (Some systems only have 'nc'.) Delete redundant UnixPipes example.
m ({{omit from|GUISS}})
(Fix UNIX Shell to run 'nc', not 'netcat'. (Some systems only have 'nc'.) Delete redundant UnixPipes example.)
Line 677:
#! The actual server
[ " hello socket world" server.send ] 256 server.start</lang>
 
=={{header|UnixPipes}}==
<lang bash>(echo "hello socket world" | nc localhost 256 | exit 0)</lang>
 
=={{header|UNIX Shell}}==
Using netcat:
 
{{libheader|nc}}
<lang bash>(echo "hello socket world" | nc localhost 256 | exit 0)</lang>
 
When the connection fails, <code>nc</code> exits 1. To see an error message, use <code>nc -v localhost 256</code>.
Using the program <tt>netcat</tt> (<tt>nc</tt>)
 
<lang bash>echo "hello socket world" | netcat localhost 256</lang>
=={{header|Visual Basic .NET}}==
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.