Example #1
0
 public QueenAnt(QueenLoader loader)
 {
     _netronics = new Netronics(
         Properties.CreateProperties(
         new IPEndPoint(IPAddress.Any, loader.GetPort()),
         new ChannelPipe().SetCreateChannelAction(channel=>
             {
                 channel.SetConfig("encoder", BsonEncoder.Encoder);
                 channel.SetConfig("decoder", BsonDecoder.Decoder);
                 channel.SetConfig("handler", this);
             })));
     _netronics.Start();
 }
Example #2
0
 public static void Load(AntConfig config)
 {
     Loader loader = null;
     switch (config.GetServerType())
     {
         case "queen":
             loader = new QueenLoader();
             break;
         case "ant":
             loader = new AntLoader();
             break;
     }
     if (loader == null)
         return;
     loader._config = config;
     loader.Load();
 }