* get HTTP protocol parameters to which the sender must adhere to
* @return the applicable HTTP protocol parameters
*/
private HttpParams getClientParameters() {
NHttpConfiguration cfg = NHttpConfiguration.getInstance();
HttpParams params = new BasicHttpParams();
params
.setIntParameter(HttpConnectionParams.SO_TIMEOUT,
cfg.getProperty(HttpConnectionParams.SO_TIMEOUT, 60000))
.setIntParameter(HttpConnectionParams.CONNECTION_TIMEOUT,
cfg.getProperty(HttpConnectionParams.CONNECTION_TIMEOUT, 10000))
.setIntParameter(HttpConnectionParams.SOCKET_BUFFER_SIZE,
cfg.getProperty(HttpConnectionParams.SOCKET_BUFFER_SIZE, 8 * 1024))
.setBooleanParameter(HttpConnectionParams.STALE_CONNECTION_CHECK,
cfg.getProperty(HttpConnectionParams.STALE_CONNECTION_CHECK, 0) == 1)
.setBooleanParameter(HttpConnectionParams.TCP_NODELAY,
cfg.getProperty(HttpConnectionParams.TCP_NODELAY, 1) == 1)
.setParameter(HttpProtocolParams.USER_AGENT, "Synapse-HttpComponents-NIO");
if (cfg.getBooleanValue(NIOReactorPNames.INTEREST_OPS_QUEUEING, false)) {
params.setBooleanParameter(NIOReactorPNames.INTEREST_OPS_QUEUEING, true);
}
return params;
}