Browse Source

Test

etomic
jl777 8 years ago
parent
commit
ae1f28bf8e
  1. 9
      iguana/exchanges/LP_nativeDEX.c
  2. 5
      iguana/exchanges/LP_network.c

9
iguana/exchanges/LP_nativeDEX.c

@ -302,10 +302,12 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int
memset(&pfd,0,sizeof(pfd));
pfd.fd = sock;
pfd.events = NN_POLLIN;
//if ( nn_poll(&pfd,1,1) != 1 )
// break;
if ( nn_poll(&pfd,1,1) != 1 )
break;
printf("checking sock.%d\n",sock);
if ( (recvlen= nn_recv(sock,&ptr,NN_MSG,0)) > 0 )
{
printf("got recvlen.%d\n",recvlen);
nonz++;
if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,profitmargin,ptr,recvlen,sock)) != 0 )
free(retstr);
@ -332,10 +334,13 @@ void command_rpcloop(void *myipaddr)
peer->errors--;
else continue;
}
printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock);
nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,LP_profitratio - 1.);
}
HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht
{
if ( coin->inactive != 0 )
continue;
if ( coin->bussock >= 0 )
nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.);
}

5
iguana/exchanges/LP_network.c

@ -73,7 +73,7 @@ int32_t LP_peerindsock(int32_t *peerindp)
if ( peerind < *peerindp )
continue;
*peerindp = peerind;
printf("peerind.%d -> sock %d\n",peerind,peer->pushsock);
//printf("peerind.%d -> sock %d\n",peerind,peer->pushsock);
return(peer->pushsock);
}
}
@ -609,7 +609,10 @@ int32_t LP_initpublicaddr(void *ctx,uint16_t *mypullportp,char *publicaddr,char
{
*mypullportp = 0;
if ( ispaired == 0 )
{
strcpy(publicaddr,"127.0.0.1");
return(-1);
}
while ( *mypullportp == 0 )
{
if ( (*mypullportp= LP_psock_get(connectaddr,publicaddr,ispaired)) != 0 )

Loading…
Cancel
Save