TMultiplexedProcessor
is a TProcessor
allowing a single TServer
to provide multiple services. To do so, you instantiate the processor and then register additional processors with it, as shown in the following example:
TMultiplexedProcessor processor = new TMultiplexedProcessor(); processor.registerProcessor( "Calculator", new Calculator.Processor(new CalculatorHandler())); processor.registerProcessor( "WeatherReport", new WeatherReport.Processor(new WeatherReportHandler())); TServerTransport t = new TServerSocket(9090); TSimpleServer server = new TSimpleServer(processor, t); server.serve();
|
|