Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e5e4766455 | |||
| 6e05a9d27e | |||
| 746c03196f | |||
| a05ddf7530 | |||
| 1c47fc12d1 | |||
| 1a0ce7af3a | |||
| 08b83713af | |||
| 775a962d38 |
+17
-18
@@ -109,6 +109,23 @@ ControlErrors mControl;
|
|||||||
//+------------------------------------------------------------------+
|
//+------------------------------------------------------------------+
|
||||||
bool BindSockets()
|
bool BindSockets()
|
||||||
{
|
{
|
||||||
|
sysSocket.setLinger(1000);
|
||||||
|
dataSocket.setLinger(1000);
|
||||||
|
liveSocket.setLinger(1000);
|
||||||
|
streamSocket.setLinger(1000);
|
||||||
|
indicatorDataSocket.setLinger(1000);
|
||||||
|
chartDataSocket.setLinger(1000);
|
||||||
|
chartIndicatorDataSocket.setLinger(1000);
|
||||||
|
|
||||||
|
// Number of messages to buffer in RAM.
|
||||||
|
sysSocket.setSendHighWaterMark(1000);
|
||||||
|
dataSocket.setSendHighWaterMark(1000);
|
||||||
|
liveSocket.setSendHighWaterMark(1000);
|
||||||
|
streamSocket.setSendHighWaterMark(1000);
|
||||||
|
indicatorDataSocket.setSendHighWaterMark(1000);
|
||||||
|
chartDataSocket.setReceiveHighWaterMark(1000); // TODO confirm settings
|
||||||
|
chartIndicatorDataSocket.setReceiveHighWaterMark(1000);
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
result = sysSocket.bind(StringFormat("tcp://%s:%d", HOST,SYS_PORT));
|
result = sysSocket.bind(StringFormat("tcp://%s:%d", HOST,SYS_PORT));
|
||||||
if(result == false)
|
if(result == false)
|
||||||
@@ -174,23 +191,6 @@ bool BindSockets()
|
|||||||
Print("Bound 'JsonAPIIndicator Data' socket on port ", CHART_INDICATOR_DATA_PORT);
|
Print("Bound 'JsonAPIIndicator Data' socket on port ", CHART_INDICATOR_DATA_PORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
sysSocket.setLinger(1000);
|
|
||||||
dataSocket.setLinger(1000);
|
|
||||||
liveSocket.setLinger(1000);
|
|
||||||
streamSocket.setLinger(1000);
|
|
||||||
indicatorDataSocket.setLinger(1000);
|
|
||||||
chartDataSocket.setLinger(1000);
|
|
||||||
chartIndicatorDataSocket.setLinger(1000);
|
|
||||||
|
|
||||||
// Number of messages to buffer in RAM.
|
|
||||||
sysSocket.setSendHighWaterMark(1);
|
|
||||||
dataSocket.setSendHighWaterMark(5);
|
|
||||||
liveSocket.setSendHighWaterMark(1);
|
|
||||||
streamSocket.setSendHighWaterMark(50);
|
|
||||||
indicatorDataSocket.setSendHighWaterMark(5);
|
|
||||||
chartDataSocket.setReceiveHighWaterMark(1); // TODO confirm settings
|
|
||||||
chartIndicatorDataSocket.setReceiveHighWaterMark(1);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1122,7 +1122,6 @@ void HistoryInfo(CJAVal &dataObject)
|
|||||||
data[i][0]=(long) tickArray[i].time_msc;
|
data[i][0]=(long) tickArray[i].time_msc;
|
||||||
data[i][1]=(double) tickArray[i].bid;
|
data[i][1]=(double) tickArray[i].bid;
|
||||||
data[i][2]=(double) tickArray[i].ask;
|
data[i][2]=(double) tickArray[i].ask;
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
d["data"].Set(data);
|
d["data"].Set(data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,12 @@ bool setFormingCandleBlank = true;
|
|||||||
int OnInit()
|
int OnInit()
|
||||||
|
|
||||||
{
|
{
|
||||||
|
// TODO subscribe only to own IndicatorId topic
|
||||||
|
// Subscribe to all topics
|
||||||
|
chartSubscriptionSocket.setSubscribe("");
|
||||||
|
chartSubscriptionSocket.setLinger(1000);
|
||||||
|
// Number of messages to buffer in RAM.
|
||||||
|
chartSubscriptionSocket.setReceiveHighWaterMark(1000); // TODO confirm settings
|
||||||
bool result = chartSubscriptionSocket.connect(StringFormat("tcp://%s:%d", HOST, CHART_SUB_PORT));
|
bool result = chartSubscriptionSocket.connect(StringFormat("tcp://%s:%d", HOST, CHART_SUB_PORT));
|
||||||
if(result == false)
|
if(result == false)
|
||||||
{
|
{
|
||||||
@@ -50,15 +55,7 @@ int OnInit()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(debug)
|
Print("Accepting Chart Indicator data on port ", CHART_SUB_PORT);
|
||||||
Print("Accepting Chart Indicator data on port ", CHART_SUB_PORT);
|
|
||||||
// TODO subscribe only to own IndicatorId topic
|
|
||||||
// Subscribe to all topics
|
|
||||||
chartSubscriptionSocket.setSubscribe("");
|
|
||||||
//chartSubscriptionSocket.setLinger(1000);
|
|
||||||
chartSubscriptionSocket.setLinger(10000);
|
|
||||||
// Number of messages to buffer in RAM.
|
|
||||||
chartSubscriptionSocket.setReceiveHighWaterMark(5); // TODO confirm settings
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--- indicator buffers mapping;
|
//--- indicator buffers mapping;
|
||||||
|
|||||||
Reference in New Issue
Block a user