diff --git a/.gitignore b/.gitignore index 5370c8638..92b11bd00 100755 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,7 @@ agents/* iguana/confs/BTC_hdrs.txt + +deprecated/.DS_Store + +.DS_Store diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index 976ff9f12..b7404656e 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -387,21 +387,19 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) #ifndef WIN32 if ( 1 )//&& bindflag != 0 ) { - if ( 1 ) - { - 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)); + } + setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,(void *)&opt,sizeof(opt)); #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 = 10000; + setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout)); setsockopt(sock,SOL_SOCKET,SO_NOSIGPIPE,&opt,sizeof(opt)); #endif #endif