Browse Source

Ifdef electrum connect timeout

pass-iguana-arg
jl777 7 years ago
parent
commit
4d3bb7d04e
  1. 7
      iguana/exchanges/LP_socket.c

7
iguana/exchanges/LP_socket.c

@ -201,7 +201,8 @@ int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port)
#endif
if ( bindflag == 0 )
{
if ( 1 ) // connect using async to allow timeout, then switch to sync
#ifdef _WIN32
//if ( 1 ) // connect using async to allow timeout, then switch to sync
{
uint32_t starttime = (uint32_t)time(NULL);
//printf("call connect sock.%d\n",sock);
@ -213,7 +214,8 @@ int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port)
timeout.tv_usec = 0;
setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout));
}
else
#else
//else
{
result = connect(sock,(struct sockaddr *)&saddr,addrlen);
if ( result != 0 )
@ -227,6 +229,7 @@ int32_t LP_socket(int32_t bindflag,char *hostname,uint16_t port)
return(-1);
}
}
#endif
}
else
{

Loading…
Cancel
Save