Martin Visser wrote:
Del,

I just did a simple test, that might help you to a solution

1. Used mkfifo to create 3 pipes "mkfifo /tmp/r1;mkfifo /tmp/r2;mkfifo
/tmp/r3;"
2. Used "tee -a" to write a copy of data to each of these - "(while [ 1
]; do date; sleep 1; done )  | tee -a /tmp/r1 | tee -a /tmp/r2 | tee -a
/tmp/r3"
3. In 3 separate terminals did a "cat /tmp/r1" (and r2 and r3).

This *mostly* works, but killing one listening process seems to cause
the others to abort. I am guessing there is some foo I am not aware of.

It doesn't solve the problem that I can't have two clients both connected to a listening TCP port on the machine and both receiving the same data.

I can create a listener on one of the FIFOs above like this:

socat -u /tmp/r1 TCP-LISTEN:25555,fork,reuseaddr

However I still hit the same issue -- the first client connects to port 25555 and gets the data, the second listener connects to port 25555 and then each client gets half of the data.

A partial workaround appears to be to create a separate listener for each client, e.g.

socat -u /tmp/r1 TCP-LISTEN:25555
socat -u /tmp/r2 TCP-LISTEN:25556
socat -u /tmp/r3 TCP-LISTEN:25557

... but that appears to defeat the purpose somewhat. I now have to configure each client to connect to a separate port.

--
Del
Babel Com Australia
http://www.babel.com.au/
ph: 02 9966 9476
fax: 02 9906 2864
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to