Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            MySampleService service = new MySampleService();

            SampleService.Processor processor = new SampleService.Processor(service);

            TServerTransport serverTransport = new TServerSocket(10240);
            TServer          server          = new TThreadPoolServer(processor, serverTransport);

            System.Console.WriteLine("server listening at tcp://localhost:10240/");
            //绑定
            server.setEventHandler(new ServerTServerEventHandler());

            server.Serve();
        }