jl777 8 years ago
parent
commit
2c906af1ff
  1. 2
      basilisk/basilisk.c
  2. 9
      iguana/iguana_peers.c

2
basilisk/basilisk.c

@ -795,7 +795,7 @@ void basilisk_p2p(void *_myinfo,void *_addr,char *senderip,uint8_t *data,int32_t
len += iguana_rwnum(0,data,sizeof(basilisktag),&basilisktag); len += iguana_rwnum(0,data,sizeof(basilisktag),&basilisktag);
//int32_t i; for (i=0; i<datalen-len; i++) //int32_t i; for (i=0; i<datalen-len; i++)
// printf("%02x",data[len+i]); // printf("%02x",data[len+i]);
if ( 0 && myinfo->NOTARY.RELAYID >= 0 ) //if ( 0 && myinfo->NOTARY.RELAYID >= 0 )
printf("RELAYID.%d ->received.%d basilisk_p2p.(%s) from %s tag.%u\n",myinfo->NOTARY.RELAYID,datalen,type,senderip!=0?senderip:"?",basilisktag); printf("RELAYID.%d ->received.%d basilisk_p2p.(%s) from %s tag.%u\n",myinfo->NOTARY.RELAYID,datalen,type,senderip!=0?senderip:"?",basilisktag);
basilisk_msgprocess(myinfo,_addr,ipbits,type,basilisktag,&data[len],datalen - len); basilisk_msgprocess(myinfo,_addr,ipbits,type,basilisktag,&data[len],datalen - len);
} }

9
iguana/iguana_peers.c

@ -413,6 +413,9 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port)
closesocket(sock); closesocket(sock);
return(-1); return(-1);
} }
timeout.tv_sec = 10000000;
timeout.tv_usec = 0;
setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout));
} }
else else
{ {
@ -448,9 +451,9 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port)
} }
} }
#ifdef __APPLE__ #ifdef __APPLE__
timeout.tv_sec = 0; //timeout.tv_sec = 0;
timeout.tv_usec = 30000; //timeout.tv_usec = 30000;
setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); //setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout));
timeout.tv_sec = 0; timeout.tv_sec = 0;
timeout.tv_usec = 10000; timeout.tv_usec = 10000;
setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout)); setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout));

Loading…
Cancel
Save