Browse Source

Test

etomic
jl777 8 years ago
parent
commit
d189e2f8b3
  1. 16
      iguana/dpow/dpow_network.c
  2. 2
      iguana/iguana777.h

16
iguana/dpow/dpow_network.c

@ -149,7 +149,7 @@ int32_t signed_nn_recv(void **freeptrp,void *ctx,uint8_t notaries[64][33],int32_
{ {
//for (i=0; i<recvbytes; i++) //for (i=0; i<recvbytes; i++)
// printf("%02x",((uint8_t *)sigpacket)[i]); // printf("%02x",((uint8_t *)sigpacket)[i]);
//printf(" <- RECV.%d crc.%08x cmp.%d\n",recvbytes,calc_crc32(0,(void *)sigpacket,recvbytes),sigpacket->packetlen == recvbytes-sizeof(*sigpacket)); printf(" <- RECV.%d crc.%08x cmp.%d\n",recvbytes,calc_crc32(0,(void *)sigpacket,recvbytes),sigpacket->packetlen == recvbytes-sizeof(*sigpacket));
} }
if ( sigpacket != 0 && recvbytes > sizeof(*sigpacket) && sigpacket->packetlen == recvbytes-sizeof(*sigpacket) ) if ( sigpacket != 0 && recvbytes > sizeof(*sigpacket) && sigpacket->packetlen == recvbytes-sizeof(*sigpacket) )
{ {
@ -285,11 +285,11 @@ char *_dex_reqsend(struct supernet_info *myinfo,char *handler,uint8_t *key,int32
{ {
if ( reqsock >= 0 ) if ( reqsock >= 0 )
{ {
timeout = 100; timeout = 1000;
nn_setsockopt(reqsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(reqsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout));
//timeout = 3000; timeout = 5000;
//nn_setsockopt(reqsock,NN_TCP,NN_RECONNECT_IVL,&timeout,sizeof(timeout)); nn_setsockopt(reqsock,NN_TCP,NN_RECONNECT_IVL,&timeout,sizeof(timeout));
timeout = 3000; timeout = 10000;
nn_setsockopt(reqsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(reqsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout));
for (i=0; i<sizeof(myinfo->dexseed_ipaddrs)/sizeof(*myinfo->dexseed_ipaddrs); i++) for (i=0; i<sizeof(myinfo->dexseed_ipaddrs)/sizeof(*myinfo->dexseed_ipaddrs); i++)
if ( nn_connect(reqsock,nanomsg_tcpname(0,str,myinfo->dexseed_ipaddrs[i],REP_SOCK)) < 0 ) if ( nn_connect(reqsock,nanomsg_tcpname(0,str,myinfo->dexseed_ipaddrs[i],REP_SOCK)) < 0 )
@ -318,9 +318,9 @@ char *_dex_reqsend(struct supernet_info *myinfo,char *handler,uint8_t *key,int32
nn_setsockopt(subsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(subsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout));
nn_setsockopt(subsock,NN_SUB,NN_SUB_SUBSCRIBE,"",0); nn_setsockopt(subsock,NN_SUB,NN_SUB_SUBSCRIBE,"",0);
printf("CLIENT sockets req.%d sub.%d\n",reqsock,subsock); printf("CLIENT sockets req.%d sub.%d\n",reqsock,subsock);
//timeout = 3000; timeout = 5000;
//nn_setsockopt(reqsock,NN_TCP,NN_RECONNECT_IVL,&timeout,sizeof(timeout)); nn_setsockopt(reqsock,NN_TCP,NN_RECONNECT_IVL,&timeout,sizeof(timeout));
timeout = 3000; timeout = 10000;
nn_setsockopt(reqsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(reqsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout));
} }
} }

2
iguana/iguana777.h

@ -133,7 +133,7 @@ struct supernet_info
struct liquidity_info linfos[512]; cJSON *liquidity_currencies; struct pending_trade *trades; portable_mutex_t pending_mutex; struct liquidity_info linfos[512]; cJSON *liquidity_currencies; struct pending_trade *trades; portable_mutex_t pending_mutex;
struct komodo_notaries NOTARY; struct komodo_notaries NOTARY;
char seedipaddr[64]; uint32_t dpowipbits[128]; int32_t numdpowipbits; portable_mutex_t notarymutex,dpowmutex; char seedipaddr[64]; uint32_t dpowipbits[128]; int32_t numdpowipbits; portable_mutex_t notarymutex,dpowmutex;
char dexseed_ipaddrs[3][64]; uint32_t dexipbits[128]; int32_t numdexipbits; portable_mutex_t dexmutex; char dexseed_ipaddrs[2][64]; uint32_t dexipbits[128]; int32_t numdexipbits; portable_mutex_t dexmutex;
// compatibility // compatibility
bits256 pangea_category,instantdex_category; bits256 pangea_category,instantdex_category;
uint8_t logs[256],exps[510]; uint8_t logs[256],exps[510];

Loading…
Cancel
Save