Browse Source

Test

etomic
jl777 7 years ago
parent
commit
f8253540fe
  1. 18
      iguana/exchanges/LP_network.c

18
iguana/exchanges/LP_network.c

@ -140,7 +140,7 @@ struct LP_queue
{
struct LP_queue *next,*prev;
int32_t sock,peerind,msglen;
uint32_t starttime,crc32;
uint32_t starttime,crc32,notready;
uint8_t msg[];
} *LP_Q;
int32_t LP_Qenqueued,LP_Qerrors,LP_Qfound;
@ -304,6 +304,8 @@ void queue_loop(void *arg)
n++;
flag = 0;
if ( ptr->sock >= 0 )
{
if ( ptr->notready == 0 || (rand() % ptr->notready) == 0 )
{
if ( LP_sockcheck(ptr->sock) > 0 )
{
@ -316,7 +318,13 @@ void queue_loop(void *arg)
ptr->sock = -1;
if ( ptr->peerind > 0 )
ptr->starttime = (uint32_t)time(NULL);
} //else printf("sock not ready to send.%d\n",ptr->msglen);
}
else
{
if ( ptr->notready++ > 1000 )
flag = 1;
}
}
}
else if ( 0 && time(NULL) > ptr->starttime+13 )
{
@ -352,11 +360,9 @@ void queue_loop(void *arg)
}
if ( arg == 0 )
break;
//if ( n != 0 )
// printf("LP_Q.[%d]\n",n);
if ( n != 0 )
if ( n+nonz != 0 )
printf("queue_loop nonz.%d n.%d\n",nonz,n);
usleep(50000);
else usleep(50000);
}
}

Loading…
Cancel
Save