|
|
@ -264,16 +264,16 @@ int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pu |
|
|
|
|
|
|
|
int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock) |
|
|
|
{ |
|
|
|
int32_t recvlen=1,nonz = 0; void *ptr; char *retstr; //struct nn_pollfd pfd;
|
|
|
|
int32_t recvlen=1,nonz = 0; void *ptr; char *retstr; struct nn_pollfd pfd; |
|
|
|
if ( sock >= 0 ) |
|
|
|
{ |
|
|
|
while ( nonz < 1000 && recvlen > 0 ) |
|
|
|
{ |
|
|
|
/*memset(&pfd,0,sizeof(pfd));
|
|
|
|
memset(&pfd,0,sizeof(pfd)); |
|
|
|
pfd.fd = sock; |
|
|
|
pfd.events = NN_POLLIN; |
|
|
|
if ( nn_poll(&pfd,1,1) != 1 ) |
|
|
|
break;*/ |
|
|
|
break; |
|
|
|
if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 ) |
|
|
|
{ |
|
|
|
nonz++; |
|
|
|