From 105d2e5ae8541ef889e7e88627039e7106bbbd3c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 17 Sep 2016 15:43:04 -0300 Subject: [PATCH] test --- iguana/iguana_peers.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index d2d1c14ce..71d0be7c5 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -439,14 +439,6 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) return(-1); } } -//#ifdef __APPLE__ - timeout.tv_sec = 0; - timeout.tv_usec = 30000; - setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); - timeout.tv_sec = 0; - timeout.tv_usec = 1000; - setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout)); -//#endif if ( listen(sock,64) != 0 ) { printf("listen(%s) port.%d failed: %s sock.%d. errno.%d\n",hostname,port,strerror(errno),sock,errno); @@ -455,6 +447,12 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) return(-1); } } + timeout.tv_sec = 0; + timeout.tv_usec = 300000; + setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); + timeout.tv_sec = 0; + timeout.tv_usec = 100000; + setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout)); return(sock); }