#This enables a local connection from an external device using a TCP_IP protocol.
#The handshake is manual, I fixed some keywords please feel free to implement yours.
#The main drawback: there is no access to the GUI anymore.
#The remote part should send a disconnect message ("CLOSECONN") to break the loop.
#If pipe is broken due to some kind of error, the TCP connection should manually closed from another terminal. (Not to close whole GUI which resets the homing settings)
#This part should definetely be improved and can be customized for different applications.
#Manual termination of TCP Example:
#Find the offending process: netstat -np
#Find the socket file descriptor: lsof -np $PID
#Debug the process: gdb -p $PID
#Close the socket: call close($FD)
#Close the debugger: quit Source: https://www.scm.keele.ac.uk/staff/stan/2016/05/16/closing-sockets-without-killing-processes/
#Unfortunately the debian is limited. Some functions may not be found but the idea should be implementable.