|
|
@ -158,9 +158,9 @@ int32_t LP_pullsock_check(char **retstrp,char *myipaddr,int32_t pubsock,int32_t |
|
|
|
{ |
|
|
|
void *ptr; int32_t recvlen=-1,nonz = 0; |
|
|
|
*retstrp = 0; |
|
|
|
while ( pullsock >= 0 ) |
|
|
|
if ( pullsock >= 0 ) |
|
|
|
{ |
|
|
|
if ( (recvlen= nn_recv(pullsock,&ptr,NN_MSG,0)) >= 0 ) |
|
|
|
while ( (recvlen= nn_recv(pullsock,&ptr,NN_MSG,0)) >= 0 ) |
|
|
|
{ |
|
|
|
nonz++; |
|
|
|
*retstrp = LP_process_message("PULL",myipaddr,pubsock,profitmargin,ptr,recvlen,pullsock); |
|
|
@ -173,11 +173,14 @@ int32_t LP_pullsock_check(char **retstrp,char *myipaddr,int32_t pubsock,int32_t |
|
|
|
int32_t LP_subsock_check(char *myipaddr,int32_t pubsock,int32_t sock,double profitmargin) |
|
|
|
{ |
|
|
|
int32_t recvlen,nonz = 0; void *ptr; char *retstr; |
|
|
|
while ( sock >= 0 && (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) >= 0 ) |
|
|
|
if ( sock >= 0 ) |
|
|
|
{ |
|
|
|
nonz++; |
|
|
|
if ( (retstr= LP_process_message("SUB",myipaddr,pubsock,profitmargin,ptr,recvlen,sock)) != 0 ) |
|
|
|
free(retstr); |
|
|
|
while ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) >= 0 ) |
|
|
|
{ |
|
|
|
nonz++; |
|
|
|
if ( (retstr= LP_process_message("SUB",myipaddr,pubsock,profitmargin,ptr,recvlen,sock)) != 0 ) |
|
|
|
free(retstr); |
|
|
|
} |
|
|
|
} |
|
|
|
return(nonz); |
|
|
|
} |
|
|
|