Connect SOCAT connection after network failure

I use the socat command to create the tty interface on my embedded Linux device, for example:

socat pty,link=/dev/ttyS9 TCP:10.0.10.1:9999

A compound is a long distance connection along the dsl line. This line is disconnected every night and my tty interface is not working. Is it possible to create a tty interace with a mechanism for reconnecting until the server part is reconnected?

The next question: is it possible to call the socat command from a java program?

Thank you so much! Karl-Heinz

+5
source share
2 answers

Starting with version V 1.4.0.0, socat has options for repeat, forever, and interval.

So this should give you the desired behavior:

socat pty,link=/dev/ttyS9 tcp:10.0.10.1:9999,forever,interval=10,fork
+1
source

Socat , .

: socate

  while true
    do 
      socat addr1 addr2
      sleep 1
    done
+1

All Articles