7

I have a socat running nicely, executing my command when a connection comes in with the arguments provided. However, the issue I am having is that the socket is at EOF and the next time a connection comes in, the process takes 3 seconds to spin back up. The process will stay up forever, so it's socat thinking there is an EOF, at least that is my understanding.

My command is: socat -v -s -d -d tcp-listen:2600,reuseaddr,fork exec:"/usr/bin/cec-client $CEC_CLIENT_ARGS"

Relevant log lines:

2014/12/31 22:41:04 socat[4746] N socket 1 (fd 4) is at EOF
2014/12/31 22:41:05 socat[4746] N exiting with status 0

I have tried ignoreeof on both ends, to no effect. I have also tried setting timeouts, both -t and -T

1 Answers1

6

If you're using a LISTEN command like OPENSSL-LISTEN, TCP-LISTEN, etc., the fork option will spin off connections to a child process so that socat can continue receiving.

Example:

socat - OPENSSL-LISTEN:443,method=TLS1.2,verify=0,cert=cert.pem,key=key.pem,fork

Thanks to: https://unix.stackexchange.com/a/283289/15954

jtpereyda
  • 178
  • 1
  • 6