예제 #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
파일: Program.cs 프로젝트: Maartyl/cs-chan
    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;
    }