Пример #1
0
 public void Start(bool console, string[] args)
 {
     //--load configuration from json file;
     var cjson = File.ReadAllText("cached.config");
     Config = new CachedConfiguration();
     Config.MergeFrom(cjson);
     
     //-- create instance of local cache and bind network listener to it.
     Cache = new LocalCache(Config);
     var uri = new Uri(Config.Address);
     switch (uri.Scheme)
     {
         case "tcp": _net = new SocketListener(); break;
         //--case "pipe": _net = new NamedPipeListener(); break;
         default: throw new ArgumentException("address:schema");
     }
     _net.Start(uri, Cache.GetServiceProtocol);
 }