21.01.2012 01:56, Sergey Matveychuk wrote:
clients. netstat -a on server shows no connection with a client, but on
the client netstat -a shows an established connection:
I think the patch will resolve my problem.
--- src/ip.cpp.orig 2012-01-22 15:17:01.000000000 +0400
+++ src/ip.cpp 2012-01-22 15:21:21.000000000 +0400
@@ -49,6 +49,13 @@
if (s == retired_fd)
return retired_fd;
+ // Turn keep-alive on for TCP
+ if (protocol_ == IPPROTO_TCP) {
+ int optval = 1, optlen = sizeof(int);
+ int rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen);
+ errno_assert (rc != -1);
+ }
+
// If there's no SOCK_CLOEXEC, let's try the second best option. Note that
// race condition can cause socket not to be closed (if fork happens
// between socket creation and this point).
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev