From 589c1841d530a291f41a1c9d0a8a0d30c3eb5ffd Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 8 Jan 2016 19:57:03 -0300 Subject: [PATCH] test --- iguana/iguana_peers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index 69fde2c12..a63c3ebe6 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -312,12 +312,13 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) return(-1); } opt = 1; + slen = sizeof(opt); if ( bindflag != 0 ) { //timeout.tv_sec = 0; //timeout.tv_usec = 1000; //setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(char *)&timeout,sizeof(timeout)); - setsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,(int32_t)sizeof(opt)); + printf("set keepalive.%d\n",setsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,slen)); opt = 0; getsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,&slen); printf("keepalive.%d\n",opt);