Feature Request: Add support for TCP KISS Target
Greetings,
Would it be possible to add support for a KISS over TCP server (such as Direwolf and/or UZ7HO's soundmodem)? While it is possible to insert socat in between, it does not cope well when the KISS over TCP system restarts. An example of the link could be:
socat -d -d -d PTY,raw,echo=0,link=/tmp/direwolftnc TCP4:192.168.1.100:8001,reuseaddr &
This creates a "dummy" serial port at /tmp/direwolftnc and then establishes an outbound TCP connection to 192.168.1.100 on port 8001
After this is up and running, you can then launch tnc-server with:
./tnc-server --port=/tmp/direwolftnc --listen=0.0.0.0:12345
At this point we now have our tnc-server listening on 12345, forwarding it's data to /tmp/direwolftnc which is a link via socat to the actual KISS over TCP server at 192.168.1.100:8001
-> 0.0.0.0:12345 [tnc-server] -> /tmp/direwolftnc -> socat -> 192.168.1.100:8001 [Direwolf]
Functionally all this works, the part which is undesirable is what happens if there is any hiccup in the above chain. If direwolf is restarted, socat dies and then tnc-server floods it's console with:
2018/12/28 12:34:43 Error reading bytes from serial: EOF 2018/12/28 12:34:43 Error reading bytes from serial: EOF 2018/12/28 12:34:43 Error reading bytes from serial: EOF 2018/12/28 12:34:43 Error reading bytes from serial: EOF
Even if one wraps socat in a while loop to automatically respawn, tnc-server does not seem to recover nor exit (allowing a loop to restart it).
Ideally it would be nice if we could specify an IP address and port number for TCP KISS connectivity that could gracefully cope with an interruption (acknowledging the TCP connection failed and periodically retrying to establish it). If that is not feasible, have the option for tnc-server exit when there is an error reading bytes from serial, allowing the creation of a while loop to keep things running.
Thank you for this great software, the sharing of TNCs is a great asset for many services and interest.
73!