This command (serial port redirector) accepts one TCP connection: 11313:
socat PTY,link=/dev/ttyV1,echo=0,raw,unlink-close=0 TCP-LISTEN:11313,forever,reuseaddr
However, when the connection is lost, the aforementioned socat process is killed and the client cannot connect.
I can solve this problem by adding the fork option at the end of the above command. But then several clients will be able to connect. But I want to accept only one connection.
Any ideas how to achieve this?
source share