3

I have two TCP servers and each expects a client connection, but I need to have them talk to each other. This is how the connection looks like:

DEVICE -> UART -> SER2NET -> XXX <- OFONO-PHONESIM

Ser2net listens on a port and ofono-phonesim listens on a port, but ultimately I want the device to speak to the modem simulator.

It would not be hard to implement the XXX, but perhaps there is something ready available? A suggestion of a simple suitable scripting language library would be appreciated as well.

3

socat.

If I understood your problem correctly, then I can simulate your environment with three terminals.

In the first, I run nc -l -p 1337. In the second, I run nc -l -p 1338.

Now, in the third, I run

socat "TCP4-CONNECT:127.0.0.1:1337" "TCP4-CONNECT:127.0.0.1:1338"

and I am able to enter text in terminal 1 and it arrives in terminal 2. And vice versa.

  • You have got a spot on! I am accepting this answer. Thanks! – Roman Saveljev Oct 30 '15 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.