Exemplo n.º 1
0
        private static void Main(string[] args)
        {
            Mitto.Config.Initialize();

            ThreadPool.QueueUserWorkItem((s) => {
                Mitto.Server objServer = new Mitto.Server();
                objServer.Start(new Mitto.Connection.Websocket.ServerParams(IPAddress.Any, 8080), delegate(ClientConnection pClient) {
                    pClient.Disconnected += PClient_Disconnected;
                    _lstClients.Add(pClient);
                    Console.WriteLine("Client Connected");
                });
            });

            Console.CancelKeyPress += delegate(object sender, ConsoleCancelEventArgs e) {
                _quit.Set();
            };
            _quit.WaitOne();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Config.Initialize(new Config.ConfigParams()
            {
                MessageProvider = new Mitto.Messaging.MessageProvider("BandwidthLimiting.Messaging")
            });

            _objServer = new Mitto.Server();
            _objServer.Start(new ServerParams(IPAddress.Any, 8080)
            {
            }, c => {
                Console.WriteLine("Client Connected");
                c.Disconnected += C_Disconnected;
                _lstClients.Add(c);
            });

            Console.CancelKeyPress += delegate(object sender, ConsoleCancelEventArgs e) {
                _quit.Set();
            };
            _quit.WaitOne();
        }