Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.UTF8;
            var setting = new RedistQuotationProviderSetting
            {
                Server   = "192.168.1.7",
                Port     = 6379,
                Password = "******",
                Channel  = new[] { "DA_QuoteChannel" }
            };
            var provider = new RedisQuotationProvider(new SymbolStore(), setting);

            provider.Received += Provider_Received;
            provider.Start();

            Console.Read();
        }
Exemplo n.º 2
0
 public RedisQuotationProvider(ISymbolStore store, RedistQuotationProviderSetting setting)
 {
     if (store == null)
     {
         throw new ArgumentNullException(nameof(store));
     }
     if (setting == null)
     {
         throw new ArgumentNullException(nameof(setting));
     }
     _store    = store;
     _setting  = setting;
     _channels = setting.Channel;
     _options  = new ConfigurationOptions
     {
         AllowAdmin = true,
         Password   = setting.Password,
         EndPoints  =
         {
             new DnsEndPoint(setting.Server, setting.Port)
         }
     };
 }