From d3630419cc68c109bf84b6b3106c798fcbc64320 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 17 Sep 2016 12:23:20 -0300 Subject: [PATCH] test --- iguana/iguana_init.c | 2 +- iguana/iguana_peers.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/iguana_init.c b/iguana/iguana_init.c index 72220d057..9d6ec1aee 100755 --- a/iguana/iguana_init.c +++ b/iguana/iguana_init.c @@ -312,7 +312,7 @@ void iguana_parseline(struct supernet_info *myinfo,struct iguana_info *coin,int3 iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD); } #ifndef IGUANA_DISABLEPEERS - if ( (rand() % 2) == 0 ) + //if ( (rand() % 2) == 0 ) { addr = &coin->peers->active[m++]; iguana_initpeer(coin,addr,(uint32_t)calc_ipbits(line)); diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index 826059f4f..0369bf5fe 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -392,16 +392,16 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) 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 = 10000; - setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout)); - } + } opt = 0; getsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,&slen); opt = 1; //printf("keepalive.%d\n",opt); } else setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,(void *)&opt,sizeof(opt)); #ifdef __APPLE__ + timeout.tv_sec = 0; + timeout.tv_usec = 10000; + setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout)); setsockopt(sock,SOL_SOCKET,SO_NOSIGPIPE,&opt,sizeof(opt)); #endif #endif