Browse Source

Test

etomic
jl777 8 years ago
parent
commit
d766303be9
  1. 4
      iguana/exchanges/LP_nativeDEX.c
  2. 2
      iguana/exchanges/LP_statemachine.c

4
iguana/exchanges/LP_nativeDEX.c

@ -136,7 +136,7 @@ int32_t LP_pullsock_check(char *myipaddr,int32_t pubsock,int32_t pullsock,double
{ {
void *ptr; int32_t recvlen,nonz = 0; void *ptr; int32_t recvlen,nonz = 0;
printf("call nn_recv\n"); printf("call nn_recv\n");
while ( pullsock >= 0 && (recvlen= nn_recv(pullsock,&ptr,NN_MSG,0)) >= 0 ) while ( pullsock >= 0 && (recvlen= nn_recv(pullsock,&ptr,NN_MSG,NN_DONTWAIT)) >= 0 )
{ {
printf("got %d\n",recvlen); printf("got %d\n",recvlen);
nonz++; nonz++;
@ -150,7 +150,7 @@ int32_t LP_pullsock_check(char *myipaddr,int32_t pubsock,int32_t pullsock,double
int32_t LP_subsock_check(char *myipaddr,int32_t pubsock,int32_t sock,double profitmargin) int32_t LP_subsock_check(char *myipaddr,int32_t pubsock,int32_t sock,double profitmargin)
{ {
int32_t recvlen,nonz = 0; void *ptr; int32_t recvlen,nonz = 0; void *ptr;
while ( sock >= 0 && (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) >= 0 ) while ( sock >= 0 && (recvlen= nn_recv(sock,&ptr,NN_MSG,NN_DONTWAIT)) >= 0 )
{ {
nonz++; nonz++;
LP_process_message("SUB",myipaddr,pubsock,profitmargin,ptr,recvlen); LP_process_message("SUB",myipaddr,pubsock,profitmargin,ptr,recvlen);

2
iguana/exchanges/LP_statemachine.c

@ -204,7 +204,7 @@ void basilisk_swapgotdata(struct basilisk_swap *swap,uint32_t crc32,bits256 srch
int32_t basilisk_swapget(struct basilisk_swap *swap,uint32_t msgbits,uint8_t *data,int32_t maxlen,int32_t (*basilisk_verify_func)(void *ptr,uint8_t *data,int32_t datalen)) int32_t basilisk_swapget(struct basilisk_swap *swap,uint32_t msgbits,uint8_t *data,int32_t maxlen,int32_t (*basilisk_verify_func)(void *ptr,uint8_t *data,int32_t datalen))
{ {
uint8_t *ptr; bits256 srchash,desthash; uint32_t crc32,_msgbits,quoteid; int32_t i,size,offset,retval = -1; struct basilisk_swapmessage *mp = 0; uint8_t *ptr; bits256 srchash,desthash; uint32_t crc32,_msgbits,quoteid; int32_t i,size,offset,retval = -1; struct basilisk_swapmessage *mp = 0;
while ( (size= nn_recv(swap->subsock,&ptr,NN_MSG,0)) >= 0 ) while ( (size= nn_recv(swap->subsock,&ptr,NN_MSG,NN_DONTWAIT)) >= 0 )
{ {
swap->lasttime = (uint32_t)time(NULL); swap->lasttime = (uint32_t)time(NULL);
memset(srchash.bytes,0,sizeof(srchash)); memset(srchash.bytes,0,sizeof(srchash));

Loading…
Cancel
Save