use of org.apache.thrift.transport.TNonblockingSocket in project eiger by wlloyd.
the class TCustomNonblockingServerSocket method acceptImpl.
@Override
protected TNonblockingSocket acceptImpl() throws TTransportException {
TNonblockingSocket tsocket = super.acceptImpl();
if (tsocket == null || tsocket.getSocketChannel() == null)
return tsocket;
Socket socket = tsocket.getSocketChannel().socket();
// clean up the old information.
SocketSessionManagementService.instance.remove(socket.getRemoteSocketAddress());
try {
socket.setKeepAlive(this.keepAlive);
} catch (SocketException se) {
logger.warn("Failed to set keep-alive on Thrift socket.", se);
}
if (this.sendBufferSize != null) {
try {
socket.setSendBufferSize(this.sendBufferSize.intValue());
} catch (SocketException se) {
logger.warn("Failed to set send buffer size on Thrift socket.", se);
}
}
if (this.recvBufferSize != null) {
try {
socket.setReceiveBufferSize(this.recvBufferSize.intValue());
} catch (SocketException se) {
logger.warn("Failed to set receive buffer size on Thrift socket.", se);
}
}
return tsocket;
}
Aggregations