Browse Source

test

etomic
jl777 8 years ago
parent
commit
fad2841f0a
  1. 15
      iguana/exchanges/LP_nativeDEX.c

15
iguana/exchanges/LP_nativeDEX.c

@ -156,14 +156,17 @@ char *LP_process_message(char *typestr,char *myipaddr,int32_t pubsock,double pro
int32_t LP_pullsock_check(char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock,double profitmargin) int32_t LP_pullsock_check(char **retstrp,char *myipaddr,int32_t pubsock,int32_t pullsock,double profitmargin)
{ {
void *ptr; int32_t recvlen,nonz = 0; void *ptr; int32_t recvlen=-1,nonz = 0;
*retstrp = 0; *retstrp = 0;
while ( pullsock >= 0 && (recvlen= nn_recv(pullsock,&ptr,NN_MSG,0)) >= 0 ) while ( pullsock >= 0 )
{ {
if ( IAMLP == 0 ) if ( (recvlen= nn_recv(pullsock,&ptr,NN_MSG,0)) >= 0 )
printf("pullsock.%d recv.%d (%s)\n",pullsock,recvlen,(char *)ptr); {
nonz++; if ( IAMLP == 0 )
*retstrp = LP_process_message("PULL",myipaddr,pubsock,profitmargin,ptr,recvlen,pullsock); printf("pullsock.%d recv.%d (%s)\n",pullsock,recvlen,(char *)ptr);
nonz++;
*retstrp = LP_process_message("PULL",myipaddr,pubsock,profitmargin,ptr,recvlen,pullsock);
} else printf("pullsock.%d recvlen.%d\n",pullsock,recvlen);
} }
return(nonz); return(nonz);
} }

Loading…
Cancel
Save