Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
c212527494
  1. 6
      crypto777/nanosrc/aio/usock_posix.c
  2. 8
      iguana/SuperNET.c
  3. 2
      iguana/main.c

6
crypto777/nanosrc/aio/usock_posix.c

@ -1124,10 +1124,10 @@ ssize_t myrecvmsg(int32_t usock,struct msghdr *hdr,int32_t flags,int32_t len)
hdr->msg_controllen = 0; hdr->msg_controllen = 0;
if ( (nbytes= (int32_t)recv(usock,iov->iov_base,len,0)) != len ) if ( (nbytes= (int32_t)recv(usock,iov->iov_base,len,0)) != len )
{ {
//PNACL_message("myrecvmsg: partial nbytes.%d vs veclen.%d\n",(int32_t)nbytes,len); PNACL_message("myrecvmsg: partial nbytes.%d vs veclen.%d\n",(int32_t)nbytes,len);
} }
//PNACL_message("GOT nbytes.%d of len.%d from usock.%d\n",(int32_t)nbytes,len,usock); PNACL_message("GOT nbytes.%d of len.%d from usock.%d\n",(int32_t)nbytes,len,usock);
if ( 0 && nbytes > 0 ) if ( 1 && nbytes > 0 )
{ {
PNACL_message("got nbytes.%d from usock.%d [%d %d %d %d]\n",(int32_t)nbytes,usock,((uint8_t *)iov->iov_base)[0],((uint8_t *)iov->iov_base)[1],((uint8_t *)iov->iov_base)[2],((uint8_t *)iov->iov_base)[3]); PNACL_message("got nbytes.%d from usock.%d [%d %d %d %d]\n",(int32_t)nbytes,usock,((uint8_t *)iov->iov_base)[0],((uint8_t *)iov->iov_base)[1],((uint8_t *)iov->iov_base)[2],((uint8_t *)iov->iov_base)[3]);
} }

8
iguana/SuperNET.c

@ -312,7 +312,7 @@ int32_t nn_add_LBendpoints(struct supernet_info *myinfo,uint16_t LBport,uint16_t
continue; continue;
} }
//printf("epbits.%llx ipbits.%x %s\n",*(long long *)&epbits,(uint32_t)ipbits,endpoint); //printf("epbits.%llx ipbits.%x %s\n",*(long long *)&epbits,(uint32_t)ipbits,endpoint);
if ( ismyaddress(myinfo,endpoints[i]) == 0 ) if ( 1 || ismyaddress(myinfo,endpoints[i]) == 0 )
{ {
epbits = calc_epbits("tcp",ipbits,LBport,NN_REP), expand_epbits(endpoint,epbits); epbits = calc_epbits("tcp",ipbits,LBport,NN_REP), expand_epbits(endpoint,epbits);
if ( reqsock >= 0 && nn_connect(reqsock,endpoint) >= 0 ) if ( reqsock >= 0 && nn_connect(reqsock,endpoint) >= 0 )
@ -416,7 +416,7 @@ void SuperNET_announce(struct supernet_info *myinfo,char *servicename)
{ {
if ( (sendlen= nn_send(myinfo->reqsock,jsonstr,len,0)) != len ) if ( (sendlen= nn_send(myinfo->reqsock,jsonstr,len,0)) != len )
printf("announce sendlen.%ld != len.%ld\n",sendlen,len); printf("announce sendlen.%ld != len.%ld\n",sendlen,len);
else printf("announced.(%s)\n",jsonstr); else printf("announced.(%ld)\n",len);
} }
} }
@ -428,7 +428,7 @@ void SuperNET_recv(struct supernet_info *myinfo,int32_t insock,int32_t LBreq)
if ( (recvlen= nn_recv(insock,myinfo->recvbuf,SUPERNET_MAXRECVBUF,0)) > 0 ) if ( (recvlen= nn_recv(insock,myinfo->recvbuf,SUPERNET_MAXRECVBUF,0)) > 0 )
{ {
msg = (void *)myinfo->recvbuf; msg = (void *)myinfo->recvbuf;
printf("superRECV.(%s) len.%d LBreq.%d\n",msg->data,recvlen,LBreq); printf(">>>>>>>>>>>>>>>>>>>>>>>> superRECV.(%s) len.%d LBreq.%d\n",msg->data,recvlen,LBreq);
if ( (datalen= SuperNET_msgvalidate(myinfo,msg)) == 0 ) if ( (datalen= SuperNET_msgvalidate(myinfo,msg)) == 0 )
{ {
if ( myinfo->LBsock >= 0 ) if ( myinfo->LBsock >= 0 )
@ -436,7 +436,7 @@ void SuperNET_recv(struct supernet_info *myinfo,int32_t insock,int32_t LBreq)
printf("deal with packet\n"); printf("deal with packet\n");
} }
} }
} } else printf("nn_recv error %d %s\n",recvlen,nn_strerror(nn_errno()));
} }
void SuperNET_loop(void *args) void SuperNET_loop(void *args)

2
iguana/main.c

@ -328,7 +328,7 @@ void iguana_main(void *arg)
if ( arg != 0 ) if ( arg != 0 )
SuperNET_JSON(&MYINFO,cJSON_Parse(arg),0); SuperNET_JSON(&MYINFO,cJSON_Parse(arg),0);
#ifndef MINIGUANA #ifndef MINIGUANA
//SuperNET_init(&MYINFO,0,0); SuperNET_init(&MYINFO,0,0);
#endif #endif
//init_InstantDEX(); //init_InstantDEX();
while ( 1 ) while ( 1 )

Loading…
Cancel
Save