Support Board
Date/Time: Fri, 29 Nov 2024 19:49:09 +0000
Post From: DTC Protocol - JSON heartbeat (ping client->server) - bug?
[2023-01-24 08:06:19] |
User230940 - Posts: 121 |
Hello, got success: (I use Perl ) Now I send for Logon $client->send_text_frame("{\"Type\":1,\"HeartbeatIntervalInSeconds\":18,\"ClientName\":\"DTC4FMA\"}\0");
with result on Server: DTC client #11. 192.168.17.201 (3) | New receive buffer size: 262144 | 2023-01-24 08:50:05.437
DTC client #11. 192.168.17.201 (3) | Allocated send buffers: 32 of 131072 bytes. | 2023-01-24 08:50:05.438 WSServer | DTC client #11. 192.168.17.201 (3) | Start Server | 2023-01-24 08:50:05.439 WSServer | DTC client #11. 192.168.17.201 (3) | Switch to HANDSHAKE | 2023-01-24 08:50:05.439 WSServer | DTC client #11. 192.168.17.201 (3) | Switch to READY_DATA | 2023-01-24 08:50:05.439 WSServer | DTC client #11. 192.168.17.201 (3) | Response HANDSHAKE with status code 101 | 2023-01-24 08:50:05.439 JSON data: {"Type":1,"HeartbeatIntervalInSeconds":18,"ClientName":"DTC4FMA"} | 2023-01-24 08:50:05.448 DTC client #11. 192.168.17.201 | Requested heartbeat interval: 18 | 2023-01-24 08:50:05.451 DTC client #11. DTC4FMA. 192.168.17.201 | Received logon request. | 2023-01-24 08:50:05.451 DTC client #11. 192.168.17.201 (3) | Send: {"Type":2,"ProtocolVersion":8,"Result":1,"Integer_1":0,"MarketDepthUpdatesBestBidAndAsk":0,"TradingIsSupported":1,"OCOOrdersSupported":1,"OrderCancelReplaceSupported":1,"SecurityDefinitionsSupported":1,"HistoricalPriceDataSupported":0,"ResubscribeWhenMarketDataFeedAvailable":0,"MarketDepthIsSupported":1,"OneHistoricalPriceDataRequestPerConnection":0,"BracketOrdersSupported":1,"UsesMultiplePositionsPerSymbolAndTradeAccount":0,"MarketDataSupported":1,"ResultText":"Connected to SC DTC Protocol server. Service=cqg|SymbolSettings=cqg","ReconnectAddress":"","ServerName":"SC DTC Server. Build=44247","SymbolExchangeDelimiter":""} | 2023-01-24 08:50:05.451 DTC client #11. DTC4FMA. 192.168.17.201 | Sent successful Logon response message to client. Username: . Result text: Connected to SC DTC Protocol server. Service=cqg|SymbolSettings=cqg | 2023-01-24 08:50:05.451 On my Client I see the return as successful Logon (perfect): {
'MarketDepthIsSupported' => 1, 'BracketOrdersSupported' => 1, 'ReconnectAddress' => '', 'MarketDepthUpdatesBestBidAndAsk' => 0, 'OCOOrdersSupported' => 1, 'Integer_1' => 0, 'UsesMultiplePositionsPerSymbolAndTradeAccount' => 0, 'HistoricalPriceDataSupported' => 0, 'ServerName' => 'SC DTC Server. Build=44247', 'SymbolExchangeDelimiter' => '', 'ResubscribeWhenMarketDataFeedAvailable' => 0, 'SecurityDefinitionsSupported' => 1, 'ResultText' => 'Connected to SC DTC Protocol server. Service=cqg|SymbolSettings=cqg', 'OneHistoricalPriceDataRequestPerConnection' => 0, 'OrderCancelReplaceSupported' => 1, 'Type' => 2, 'TradingIsSupported' => 1, 'Result' => 1, 'MarketDataSupported' => 1, 'ProtocolVersion' => 8 }; Additionally I see the heartbeat request Type 3 which comes JSON Compact encoded. {
'Type' => 3, 'F' => [ 0, 1674546515, 0, 0, 0, 0, '1674546514862035', 0, 762, 0, 0, 3232239923 ] }; What do I have to answer on the heartbeat request? Do I have to answer in JSON Compact Encoding too? Thanks for help |