Start socat. It is used for emulation of transport disconnects socat -d TCP-LISTEN:8001,fork,reuseaddr TCP:localhost:8000 start ResumeFileTransfer.main terminate/start socat periodically for session resumption ResumeFileTransfer output is nil