netdev
[Top] [All Lists]

Re: Re: program "sock" by Richard Stevens

To: "netdev@xxxxxxxxxxx" <netdev@xxxxxxxxxxx>
Subject: Re: Re: program "sock" by Richard Stevens
From: Laurence <laudney@xxxxxxxx>
Date: Sat, 16 Feb 2002 9:58:51 +0800
Organization: SJTU
Reply-to: laudney@xxxxxxxx
Sender: owner-netdev@xxxxxxxxxxx
>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:
1. client:
        sock bsd echo
        establishes a tcp connection to bsd's echo service

2. server:
        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 
        the client

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


-- Laudney



<Prev in Thread] Current Thread [Next in Thread>