Inheritance: IServerEventHandler
 static void Main(string[] arguments)
 {
     var serialiser = new Serialiser<ServerConfiguration>(ConfigurationPath);
     ServerConfiguration configuration = serialiser.Load();
     ServerHandler handler = new ServerHandler(configuration);
     handler.Run();
     ManualResetEvent resetEvent = new ManualResetEvent(false);
     resetEvent.WaitOne();
 }
Example #2
0
        static void Main(string[] args)
        {
            FastNetwork.Log.Trace.EnableConsole();
            ServerHandler         handler  = new ServerHandler();
            DefaultBinaryProtocol protocal = new DefaultBinaryProtocol();

            SocketServer server = new SocketServer(handler, new DefaultEncoder(), new DefaultDecoder());

            server.AddListener("tcp", new System.Net.IPEndPoint(IPAddress.Any, 8008));
            try
            {
                server.Start();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }

            Console.WriteLine("server start");
            Console.ReadLine();
        }
Example #3
0
        static void Main(string[] args)
        {
            FastNetwork.Log.Trace.EnableConsole();
            ServerHandler handler = new ServerHandler();
            DefaultBinaryProtocol protocal = new DefaultBinaryProtocol();

            SocketServer server = new SocketServer(handler, new DefaultEncoder(),new DefaultDecoder());

            server.AddListener("tcp", new System.Net.IPEndPoint(IPAddress.Any,8008));
            try
            {
                server.Start();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }

            Console.WriteLine("server start");
            Console.ReadLine();
        }