Reconnect socat connection after network failure

守給你的承諾、 提交于 2019-12-04 09:51:24

As of version V 1.4.0.0 socat features the options "retry", "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

Socat is designed to exit when one connection closes.

Workaround: put a infinite loop around your socat start

  while true
    do 
      socat addr1 addr2
      sleep 1
    done
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!