Пример #1
0
        static void Main(string[] args)
        {
            Server server = new Server();

            InitializationData initializationData = new InitializationData {properties = Util.createProperties()};
            initializationData.properties.setProperty("Ice.ThreadPool.Client.Size", "1");
            initializationData.properties.setProperty("Ice.ThreadPool.Client.SizeMax", "10");
            initializationData.properties.setProperty("Ice.ThreadPool.Server.Size", "1");
            initializationData.properties.setProperty("Ice.ThreadPool.Server.SizeMax", "10");
            initializationData.properties.setProperty("Ice.ACM.Client", "0");

            Environment.Exit(server.main(args, initializationData));
        }
Пример #2
0
		public static void Main(string[] args){




			if(args.Length>0){
				server = new Server();
				Console.ReadLine();
			}
			else{
				Console.WriteLine("NAME: ");
				client = new Client(Console.ReadLine());
				ClientConsole();
			}
		
		}
Пример #3
0
    public static Server Start(int port) {
      var c2sLoc = new Uri("chan:client2server");
      var s2cLoc = new Uri("chan:server2client");
      var s = new Server();
      var ss = s.store;

      var cfg = NetChanConfig.MakeDefault<string>();
      var t1 = ss.CreateNetChan(c2sLoc.AbsolutePath, cfg);
      var t2 = ss.CreateNetChan(s2cLoc.AbsolutePath, cfg, ChanDistributionType.Broadcast);

      ss.StartServer(port);

      ChanEvent.Listen(ss.GetReceiver<string>(c2sLoc), Console.WriteLine);
      s.Sender = ss.GetSender<string>(s2cLoc);

      s.Task = Task.WhenAny(t1, t2);
      return s;
    }