I'm running some performance testing, and I'm trying to send the same file repeatedly to a socket.
If I do something like:
$ socat -b1048576 -u OPEN:/dev/zero TCP4-LISTEN:9899,reuseaddr,fork
$ socat -b1048576 -u TCP:127.0.0.1:9899 OPEN:/dev/null
Then with that 1MB buffer iftop tells me that I'm pushing 20Gbps.
However, what I'm really trying to do is something more like:
$ socat -b1048576 -u OPEN:somefile.dat TCP4-LISTEN:9899,reuseaddr,fork
$ myprog TCP:127.0.0.1:9899 > /dev/null
But it only pushes that somefile.dat one time, I'd really like it to rewind() to the beginning and send it again.