|
@ -299,10 +299,6 @@ int32_t LP_nanomsg_recvs(void *ctx) |
|
|
int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; double milli; |
|
|
int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; double milli; |
|
|
if ( (origipaddr= LP_myipaddr) == 0 ) |
|
|
if ( (origipaddr= LP_myipaddr) == 0 ) |
|
|
origipaddr = "127.0.0.1"; |
|
|
origipaddr = "127.0.0.1"; |
|
|
milli = OS_milliseconds(); |
|
|
|
|
|
if ( lastmilli > 0. && milli > lastmilli+3000 ) |
|
|
|
|
|
fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); |
|
|
|
|
|
lastmilli = milli; |
|
|
|
|
|
//portable_mutex_lock(&LP_nanorecvsmutex);
|
|
|
//portable_mutex_lock(&LP_nanorecvsmutex);
|
|
|
HASH_ITER(hh,LP_peerinfos,peer,tmp) |
|
|
HASH_ITER(hh,LP_peerinfos,peer,tmp) |
|
|
{ |
|
|
{ |
|
@ -317,7 +313,11 @@ int32_t LP_nanomsg_recvs(void *ctx) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock);
|
|
|
//printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock);
|
|
|
|
|
|
milli = OS_milliseconds(); |
|
|
nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); |
|
|
nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); |
|
|
|
|
|
if ( lastmilli > 0. && milli > lastmilli+1000 ) |
|
|
|
|
|
fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); |
|
|
|
|
|
lastmilli = milli; |
|
|
} |
|
|
} |
|
|
/*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht
|
|
|
/*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht
|
|
|
{ |
|
|
{ |
|
@ -327,7 +327,13 @@ int32_t LP_nanomsg_recvs(void *ctx) |
|
|
nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); |
|
|
nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); |
|
|
}*/ |
|
|
}*/ |
|
|
if ( LP_mypullsock >= 0 ) |
|
|
if ( LP_mypullsock >= 0 ) |
|
|
|
|
|
{ |
|
|
|
|
|
milli = OS_milliseconds(); |
|
|
nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); |
|
|
nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); |
|
|
|
|
|
if ( lastmilli > 0. && milli > lastmilli+1000 ) |
|
|
|
|
|
fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); |
|
|
|
|
|
lastmilli = milli; |
|
|
|
|
|
} |
|
|
//portable_mutex_unlock(&LP_nanorecvsmutex);
|
|
|
//portable_mutex_unlock(&LP_nanorecvsmutex);
|
|
|
return(nonz); |
|
|
return(nonz); |
|
|
} |
|
|
} |
|
|