This depends on the preceding daemonlib patch and an ms-queuedaemon
restart.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
my $qserv= tcpconnect($c{QueueDaemonHost}, $c{QueueDaemonPort});
$qserv->autoflush(1);
+ # TCP connections can get into a weird state where the client
+ # thinks the connection is open but the server has no record
+ # of it. To avoid this, have the client speak without waiting
+ # for the server.
+ #
+ # See A TCP "stuck" connection mystery"
+ # https://www.evanjones.ca/tcp-stuck-connection-mystery.html
+ print $qserv "noop\n";
$_= <$qserv>; defined && m/^OK ms-queuedaemon\s/ or die "$_?";
+ $_= <$qserv>; defined && m/^OK noop\s/ or die "$_?";
return $qserv;
}