Browse Source

Test

etomic
jl777 8 years ago
parent
commit
f6e15c7d14
  1. 2
      iguana/exchanges/LP_forwarding.c
  2. 3
      iguana/exchanges/LP_include.h
  3. 4
      iguana/exchanges/LP_nativeDEX.c

2
iguana/exchanges/LP_forwarding.c

@ -85,7 +85,7 @@ int32_t LP_hellos()
int32_t LP_pushsock_create(struct LP_forwardinfo *ptr,char *pushaddr)
{
int32_t pushsock,timeout;
if ( (pushsock= nn_socket(AF_SP,NN_PUSH)) < 0 )
if ( (pushsock= nn_socket(AF_SP,LP_COMMAND_SENDSOCK)) < 0 )
{
printf("LP_pushsock_create couldnt allocate socket for %s\n",pushaddr);
return(-1);

3
iguana/exchanges/LP_include.h

@ -21,6 +21,9 @@
#ifndef LP_INCLUDE_H
#define LP_INCLUDE_H
#define LP_COMMAND_SENDSOCK NN_REQ
#define LP_COMMAND_RECVSOCK NN_REP
#define LP_HTTP_TIMEOUT 1
#define LP_MAXPEER_ERRORS 3
#define LP_SWAPSTEP_TIMEOUT 3

4
iguana/exchanges/LP_nativeDEX.c

@ -349,7 +349,7 @@ void LP_mainloop(char *myipaddr,struct LP_peerinfo *mypeer,uint16_t mypubport,in
void nn_tests(int32_t pullsock,char *pushaddr)
{
int32_t sock,n,timeout,m=0; char msg[512];//void *ptr;
if ( (sock= nn_socket(AF_SP,NN_REQ)) >= 0 )
if ( (sock= nn_socket(AF_SP,LP_COMMAND_SENDSOCK)) >= 0 )
{
if ( nn_connect(sock,pushaddr) < 0 )
printf("connect error %s\n",nn_strerror(nn_errno()));
@ -409,7 +409,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,double profit
} else printf("error getting myipaddr\n");
} else printf("error issuing curl\n");
nanomsg_transportname(0,pushaddr,myipaddr,mypullport);
if ( (pullsock= nn_socket(AF_SP,NN_REP)) >= 0 )
if ( (pullsock= nn_socket(AF_SP,LP_COMMAND_RECVSOCK)) >= 0 )
{
timeout = 1;
nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout));

Loading…
Cancel
Save