I'm trying to use TNonblockingServerSocket
with TFramedTransport
on both client and server side but get the following error:
TTransportException: java.net.SocketException: Software caused connection abort: recv failed
.
Server code:
TServerTransport serverTransport = new TNonblockingServerSocket(9090);
TThreadPoolServer.Args args = new TThreadPoolServer.Args(serverTransport);
args.processor(processor);
args.transportFactory(new TFramedTransport.Factory());
TServer server = new TThreadPoolServer(args);
server.serve();
Client code:
transport = new TSocket("localhost", 9090);
transport.open();
TProtocol protocol = new TBinaryProtocol(new TFramedTransport(transport));
Calculator.Client client = new Calculator.Client(protocol);
Everything works fine when switching back to TServerSocket
instead of TNonblockingServerSocket
- even with the framed transport.
Any idea what I'm missing here?
I switched to THsHaServer
instead of TThreadPoolServer and everything worked fine. Strange.
I Still don't know why it didn't work with TThreadPoolServer
:(