Browse Source

undo skip poll, socked isnt binding

blackjok3r
blackjok3r 6 years ago
parent
commit
2d522edb7d
  1. 8
      iguana/dpow/dpow_network.c

8
iguana/dpow/dpow_network.c

@ -2205,17 +2205,17 @@ void dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_blo
memcpy(np->packet,data,datalen); memcpy(np->packet,data,datalen);
sentbytes = -1; sentbytes = -1;
// deadlocks! portable_mutex_lock(&myinfo->dpowmutex); // deadlocks! portable_mutex_lock(&myinfo->dpowmutex);
maxiters = 2; maxiters = 100;
for (i=0; i<maxiters; i++) for (i=0; i<maxiters; i++)
{ {
struct nn_pollfd pfd; struct nn_pollfd pfd;
pfd.fd = myinfo->dpowsock; pfd.fd = myinfo->dpowsock;
pfd.events = NN_POLLOUT; pfd.events = NN_POLLOUT;
//if ( nn_poll(&pfd,1,10) > 0 ) if ( nn_poll(&pfd,1,10) > 0 )
//{ {
sentbytes = signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->dpowsock,np,size); sentbytes = signed_nn_send(myinfo,myinfo->ctx,myinfo->persistent_priv,myinfo->dpowsock,np,size);
break; break;
//} }
usleep(1000); usleep(1000);
} }
if ( i == maxiters ) if ( i == maxiters )

Loading…
Cancel
Save