Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var handler   = new ThriftServiceHandler();
            var processor = new MultiplicationService.Processor(handler);

            TServerTransport transport = new TServerSocket(9090);
            TServer          server    = new TThreadPoolServer(processor, transport);

            Console.WriteLine("going to serve...");

            server.Serve();
        }
Ejemplo n.º 2
0
            public void Begin()
            {
                try
                {
                    var handler   = new MultiplicationHandler();
                    var processor = new MultiplicationService.Processor(handler);
                    TServerTransport serverTransport = new TServerSocket(Port);
                    _server = new TSimpleServer(processor, serverTransport);
                    Console.WriteLine("Starting the server...");

                    // The next call will ...
                    // ... create a new thrift server on a new thread (Thrift design)
                    // ... that thread runs till server.Stop() is called
                    // ... this thread is blocked till then
                    _server.Serve();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }

                Console.WriteLine("Server, done.");
            }
            public void Begin()
            {
                try
                {
                    var handler = new MultiplicationHandler();
                    var processor = new MultiplicationService.Processor(handler);
                    TServerTransport serverTransport = new TServerSocket(Port);
                    _server = new TSimpleServer(processor, serverTransport);
                    Console.WriteLine("Starting the server...");

                    // The next call will ...
                    // ... create a new thrift server on a new thread (Thrift design)
                    // ... that thread runs till server.Stop() is called
                    // ... this thread is blocked till then
                    _server.Serve();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }

                Console.WriteLine("Server, done.");
            }