Beispiel #1
0
        private static void testRealtimeQuotConn()
        {
            QuotV5.Binary.ConnectionConfig cfg = new QuotV5.Binary.ConnectionConfig()
            {
                IP                  = System.Net.IPAddress.Parse("172.16.1.99"),
                TargetCompID        = "N4005Q0001          ",
                Port                = 8016,
                HeartbeatIntervalS  = 3,
                ConnectionTimeoutMS = 10000,
                ReconnectIntervalMS = 5000,
                SenderCompID        = "realtime            ",
                Password            = "******"
            };
            QuotV5.Binary.RealTimeQuotConnection conn = new QuotV5.Binary.RealTimeQuotConnection(cfg, logHelper);

            conn.OnMarketDataReceived += new Action <QuotV5.Binary.MarketDataEx>(conn_OnMarketDataReceived);
            conn.Start();
        }
Beispiel #2
0
        private QuotV5.Binary.RealTimeQuotConnection ConstructRealTimeQuotConnection(string connConfigkey, QuotV5.Binary.IMessagePackRecorder recorder = null)
        {
            var connConfig = PluginContext.Configuration.BinaryConnections.Connections.FirstOrDefault(c => c.Key == connConfigkey);

            if (connConfig == null)
            {
                throw new Exception();
            }

            QuotV5.Binary.ConnectionConfig realtimeConnConfig = new QuotV5.Binary.ConnectionConfig()
            {
                IP                  = System.Net.IPAddress.Parse(connConfig.IP),
                TargetCompID        = connConfig.TargetCompID,
                Port                = connConfig.Port,
                HeartbeatIntervalS  = connConfig.HeartbeatIntervalS,
                ConnectionTimeoutMS = connConfig.ConnectionTimeoutMS,
                ReconnectIntervalMS = connConfig.ReconnectIntervalMS,
                SenderCompID        = connConfig.SenderCompID,
                Password            = connConfig.Password
            };

            QuotV5.Binary.RealTimeQuotConnection realtimeQuotConn = new QuotV5.Binary.RealTimeQuotConnection(realtimeConnConfig, this.logHelper, recorder);
            return(realtimeQuotConn);
        }
        private QuotV5.Binary.RealTimeQuotConnection ConstructRealTimeQuotConnection(string connConfigkey,QuotV5.Binary.IMessagePackRecorder recorder=null)
        {
            var connConfig = PluginContext.Configuration.BinaryConnections.Connections.FirstOrDefault(c => c.Key == connConfigkey);
            if (connConfig == null)
                throw new Exception();

            QuotV5.Binary.ConnectionConfig realtimeConnConfig = new QuotV5.Binary.ConnectionConfig()
            {
                IP = System.Net.IPAddress.Parse(connConfig.IP),
                TargetCompID = connConfig.TargetCompID,
                Port = connConfig.Port,
                HeartbeatIntervalS = connConfig.HeartbeatIntervalS,
                ConnectionTimeoutMS = connConfig.ConnectionTimeoutMS,
                ReconnectIntervalMS = connConfig.ReconnectIntervalMS,
                SenderCompID = connConfig.SenderCompID,
                Password = connConfig.Password
            };

            QuotV5.Binary.RealTimeQuotConnection realtimeQuotConn = new QuotV5.Binary.RealTimeQuotConnection(realtimeConnConfig, this.logHelper, recorder);
            return realtimeQuotConn;
        }