本文整理汇总了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);
}
示例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);
}
示例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);
}
}
示例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);
}
}