Ejemplo n.º 1
0
        public void Start()
        {
            AppServer = new MyServer();

            var port = PortHelper.GetFirstAvailablePort();

            if (!AppServer.Setup(port))
            {
                throw new Exception("Failed to setup!");
            }
            if (!AppServer.Start())
            {
                throw new Exception("Failed to start!");
            }
            Console.WriteLine($"start at port:{port}");
            AppServer.NewRequestReceived  += StringRequesthandler;
            AppServer.NewSessionConnected += NewConnectionCome;
        }
Ejemplo n.º 2
0
 public static ICommunicator Build()
 {
     return(new HttpCommunicator(PortHelper.GetFirstAvailablePort()));
 }