>Martin Devera writes
>I don't know the answer but I'm curious - what is
>the "sock" program for ?
"sock" is a network program written by W. Richard Stevens.
It can be used both as a client and as a server and can
generate both TCP and UDP packets. It works in 4 modes:
sock bsd echo
establishes a tcp connection to bsd's echo service
sock -s 192.168.0.1 5555
runs a service on local ip address 192.168.0.1 and
port 5555. Then, this server will copy data from the
client to STDOUT and copy data input from STDIN to
3. source client:
sock -i -n12 -w4096 bsd discard
write 4096 bytes of data to the discard service on bsd
for 12 times.
4. source server:
sock -i -s 5555
discards any data received on 5555
So, "sock" is mainly used to generate tcp/udp packets across
the net. You can easily study the entire process in details.
It can be downloaded at http://home.xnet.com/~cathmike/mike/software/
and an improved GPL one at http://sourceforge.net/projects/opensock