|
|
@ -413,6 +413,9 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) |
|
|
|
closesocket(sock); |
|
|
|
return(-1); |
|
|
|
} |
|
|
|
timeout.tv_sec = 10000000; |
|
|
|
timeout.tv_usec = 0; |
|
|
|
setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -448,9 +451,9 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) |
|
|
|
} |
|
|
|
} |
|
|
|
#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 = 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)); |
|
|
@ -502,7 +505,7 @@ int32_t iguana_send(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *s |
|
|
|
#ifdef _WIN32 |
|
|
|
if ( (numsent= (int32_t)send(usock,serialized,remains,0)) < 0 ) |
|
|
|
#else |
|
|
|
if ( (numsent= (int32_t)send(usock,serialized,remains,MSG_NOSIGNAL)) < 0 ) |
|
|
|
if ( (numsent= (int32_t)send(usock,serialized,remains,MSG_NOSIGNAL)) < 0 ) |
|
|
|
#endif |
|
|
|
{ |
|
|
|
if ( errno == EAGAIN || errno == EWOULDBLOCK ) |
|
|
|