org.mortbay.jetty.Connector.setMaxIdleTime()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中org.mortbay.jetty.Connector.setMaxIdleTime()方法的一些代码示例,展示了Connector.setMaxIdleTime()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Connector.setMaxIdleTime()方法的具体详情如下:
包路径:org.mortbay.jetty.Connector
类名称:Connector
方法名:setMaxIdleTime

Connector.setMaxIdleTime介绍

暂无

代码示例

代码示例来源:origin: org.apache.maven.plugins/maven-site-plugin

private Connector getDefaultConnector()
{
  Connector connector = new SelectChannelConnector();
  connector.setPort( port );
  connector.setMaxIdleTime( MAX_IDLE_TIME );
  return connector;
}

代码示例来源:origin: opoo/opoopress

/**
 *
 * @param host localhost, 127.0.0.1 or 0.0.0.0.
 * @param port port
 * @return jetty connector
 */
protected Connector createConnector(String host, int port){
  Connector connector = new SelectChannelConnector();
  if(host != null){
    connector.setHost(host);
  }
  connector.setPort( port );
  connector.setMaxIdleTime(MAX_IDLE_TIME);
  return connector;
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/**
 * Create a required listener for the Jetty instance listening on the port
 * provided. This wrapper and all subclasses must create at least one
 * listener.
 */
protected Connector createBaseListener(Configuration conf)
  throws IOException {
 Connector ret;
 if (conf.getBoolean("hadoop.http.bio", false)) {
  SocketConnector conn = new SocketConnector();
  conn.setAcceptQueueSize(4096);
  conn.setResolveNames(false);
  ret = conn;
 } else {
  SelectChannelConnector conn = new SelectChannelConnector();
  conn.setAcceptQueueSize(128);
  conn.setResolveNames(false);
  conn.setUseDirectBuffers(false);
  ret = conn;
 }
 ret.setLowResourceMaxIdleTime(10000);
 ret.setHeaderBufferSize(conf.getInt("hadoop.http.header.buffer.size", 4096));
 ret.setMaxIdleTime(conf.getInt("dfs.http.timeout", 200000));
 return ret;
}

相关文章