/server.java Secret
Created
February 5, 2014 07:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final MessageDistributor messageDistributor = new MessageDistributor(); | |
new Thread(messageDistributor).start(); | |
TProcessorFactory processorFactory = new TProcessorFactory(null) { | |
@Override | |
public TProcessor getProcessor(TTransport trans) { | |
messageDistributor.addClient(new MessageServiceClient(trans)); | |
return new MessageService.Processor(messageDistributor); | |
} | |
}; | |
TServerTransport serverTransport = new TServerSocket(port); | |
TServer server = new TThreadPoolServer(processorFactory, serverTransport); | |
LOGGER.info("Server started"); | |
server.serve(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment