Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
e873740ace
  1. 12
      iguana/iguana_peers.c

12
iguana/iguana_peers.c

@ -280,17 +280,17 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port)
printf("socket() failed: %s errno.%d", strerror(errno),errno);
return(-1);
}
if ( 0 )
{
timeout.tv_sec = 0;
timeout.tv_usec = 1000;
setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout));
}
opt = 1;
slen = sizeof(opt);
//printf("set keepalive.%d\n",setsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,slen));
if ( 1 )//&& bindflag != 0 )
{
if ( 1 )
{
timeout.tv_sec = 0;
timeout.tv_usec = 30000;
setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout));
}
opt = 0;
getsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,&slen);
//printf("keepalive.%d\n",opt);

Loading…
Cancel
Save