当前位置: 首页>>代码示例>>Java>>正文


Java HttpConnectionParams.getLinger方法代码示例

本文整理汇总了Java中org.apache.http.params.HttpConnectionParams.getLinger方法的典型用法代码示例。如果您正苦于以下问题:Java HttpConnectionParams.getLinger方法的具体用法?Java HttpConnectionParams.getLinger怎么用?Java HttpConnectionParams.getLinger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.http.params.HttpConnectionParams的用法示例。


在下文中一共展示了HttpConnectionParams.getLinger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bind

import org.apache.http.params.HttpConnectionParams; //导入方法依赖的package包/类
@Override
public void bind(final Socket socket, final HttpParams params) throws IOException {
    if (socket == null) {
        throw new IllegalArgumentException("Socket may not be null");
    }
    if (params == null) {
        throw new IllegalArgumentException("HTTP parameters may not be null");
    }
    assertNotOpen();
    socket.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
    socket.setSoTimeout(HttpConnectionParams.getSoTimeout(params));
    socket.setKeepAlive(HttpConnectionParams.getSoKeepalive(params));

    int linger = HttpConnectionParams.getLinger(params);
    if (linger >= 0) {
        socket.setSoLinger(linger > 0, linger);
    }
    super.bind(socket, params);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:DefaultHttpServerConnection.java

示例2: bind

import org.apache.http.params.HttpConnectionParams; //导入方法依赖的package包/类
@Override
public void bind(
        final Socket socket,
        final HttpParams params) throws IOException {
    if (socket == null) {
        throw new IllegalArgumentException("Socket may not be null");
    }
    if (params == null) {
        throw new IllegalArgumentException("HTTP parameters may not be null");
    }
    assertNotOpen();
    socket.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
    socket.setSoTimeout(HttpConnectionParams.getSoTimeout(params));
    socket.setKeepAlive(HttpConnectionParams.getSoKeepalive(params));

    int linger = HttpConnectionParams.getLinger(params);
    if (linger >= 0) {
        socket.setSoLinger(linger > 0, linger);
    }
    super.bind(socket, params);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:DefaultHttpClientConnection.java

示例3: prepareSocket

import org.apache.http.params.HttpConnectionParams; //导入方法依赖的package包/类
/**
 * Performs standard initializations on a newly created socket.
 *
 * @param sock      the socket to prepare
 * @param context   the context for the connection
 * @param params    the parameters from which to prepare the socket
 *
 * @throws IOException      in case of an IO problem
 */
protected void prepareSocket(
        final Socket sock,
        final HttpContext context,
        final HttpParams params) throws IOException {
    sock.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
    sock.setSoTimeout(HttpConnectionParams.getSoTimeout(params));

    int linger = HttpConnectionParams.getLinger(params);
    if (linger >= 0) {
        sock.setSoLinger(linger > 0, linger);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:DefaultClientConnectionOperator.java

示例4: prepareSocket

import org.apache.http.params.HttpConnectionParams; //导入方法依赖的package包/类
/**
 * Performs standard initializations on a newly created socket.
 *
 * @param sock      the socket to prepare
 * @param context   the context for the connection
 * @param params    the parameters from which to prepare the socket
 *
 * @throws IOException      in case of an IO problem
 */
protected void prepareSocket(
        final Socket sock,
        final HttpContext context,
        final HttpParams params) throws IOException {
    sock.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
    sock.setSoTimeout(HttpConnectionParams.getSoTimeout(params));

    final int linger = HttpConnectionParams.getLinger(params);
    if (linger >= 0) {
        sock.setSoLinger(linger > 0, linger);
    }
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:22,代码来源:DefaultClientConnectionOperator.java


注:本文中的org.apache.http.params.HttpConnectionParams.getLinger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。