jl777 7 years ago
parent
commit
50b38e7824
  1. 9
      iguana/exchanges/LP_commands.c
  2. 5
      iguana/exchanges/LP_network.c
  3. 6
      iguana/exchanges/mm.c

9
iguana/exchanges/LP_commands.c

@ -233,23 +233,20 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\
}
else if ( strcmp(method,"getendpoint") == 0 )
{
char endpoint[64];
nanomsg_wsendpoint(1,endpoint,LP_myipaddr,7781);
retjson = cJSON_CreateObject();
if ( IPC_ENDPOINT >= 0 )
{
jaddstr(retjson,"error","IPC endpoint already exists");
jaddstr(retjson,"endpoint",endpoint);
jaddstr(retjson,"endpoint","ws://127.0.0.1");
}
else
{
if ( (IPC_ENDPOINT= nn_socket(AF_SP,NN_PUB)) >= 0 )
{
if ( nn_bind(IPC_ENDPOINT,endpoint) >= 0 )
if ( nn_bind(IPC_ENDPOINT,"ws://127.0.0.1") >= 0 )
{
jaddstr(retjson,"result","success");
nanomsg_wsendpoint(0,endpoint,LP_myipaddr,7781);
jaddstr(retjson,"endpoint",endpoint);
jaddstr(retjson,"endpoint","ws://127.0.0.1");
} else jaddstr(retjson,"error","couldnt connect to IPC_ENDPOINT");
} else jaddstr(retjson,"error","couldnt get NN_PUB socket");
}

5
iguana/exchanges/LP_network.c

@ -102,11 +102,6 @@ char *nanomsg_transportname(int32_t bindflag,char *str,char *ipaddr,uint16_t por
return(str);
}
char *nanomsg_wsendpoint(int32_t bindflag,char *str,char *ipaddr,uint16_t port)
{
sprintf(str,"ws://%s:%u",bindflag == 0 ? ipaddr : "*",port+10);
return(str);
}
/*char *nanomsg_transportname2(int32_t bindflag,char *str,char *ipaddr,uint16_t port)
{

6
iguana/exchanges/mm.c

@ -58,7 +58,8 @@ void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveas
#include "../../crypto777/nanosrc/pipeline.h"
#include "../../crypto777/nanosrc/reqrep.h"
#include "../../crypto777/nanosrc/tcp.h"
#include "../../crypto777/nanosrc/pair.h"
#include "../../crypto777/nanosrc/pair.h"
#include "../../crypto777/nanosrc/ws.h"
#else
#include "/usr/local/include/nanomsg/nn.h"
#include "/usr/local/include/nanomsg/bus.h"
@ -66,7 +67,8 @@ void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveas
#include "/usr/local/include/nanomsg/pipeline.h"
#include "/usr/local/include/nanomsg/reqrep.h"
#include "/usr/local/include/nanomsg/tcp.h"
#include "/usr/local/include/nanomsg/pair.h"
#include "/usr/local/include/nanomsg/pair.h"
#include "/usr/local/include/nanomsg/ws.h"
#endif
#endif

Loading…
Cancel
Save