本文整理汇总了Java中org.apache.tomcat.util.net.SocketWrapper.setTimeout方法的典型用法代码示例。如果您正苦于以下问题:Java SocketWrapper.setTimeout方法的具体用法?Java SocketWrapper.setTimeout怎么用?Java SocketWrapper.setTimeout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tomcat.util.net.SocketWrapper
的用法示例。
在下文中一共展示了SocketWrapper.setTimeout方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: release
import org.apache.tomcat.util.net.SocketWrapper; //导入方法依赖的package包/类
/**
* Expected to be used by the handler once the processor is no longer
* required.
*/
@Override
public void release(SocketWrapper<NioChannel> socket,
Processor<NioChannel> processor, boolean isSocketClosing,
boolean addToPoller) {
processor.recycle(isSocketClosing);
recycledProcessors.offer(processor);
if (addToPoller) {
// The only time this method is called with addToPoller == true
// is when the socket is in keep-alive so set the appropriate
// timeout.
socket.setTimeout(getProtocol().getKeepAliveTimeout());
socket.getSocket().getPoller().add(socket.getSocket());
}
}
示例2: UpgradeNioProcessor
import org.apache.tomcat.util.net.SocketWrapper; //导入方法依赖的package包/类
public UpgradeNioProcessor(SocketWrapper<NioChannel> wrapper,
UpgradeInbound upgradeInbound, NioSelectorPool pool) {
super(upgradeInbound);
wrapper.setTimeout(upgradeInbound.getReadTimeout());
this.nioChannel = wrapper.getSocket();
this.pool = pool;
this.maxRead = nioChannel.getBufHandler().getReadBuffer().capacity();
this.maxWrite = nioChannel.getBufHandler().getWriteBuffer().capacity();
}
示例3: NioProcessor
import org.apache.tomcat.util.net.SocketWrapper; //导入方法依赖的package包/类
public NioProcessor(SocketWrapper<NioChannel> wrapper,
HttpUpgradeHandler httpUpgradeProcessor, NioSelectorPool pool,
int asyncWriteBufferSize) {
super(httpUpgradeProcessor,
new NioServletInputStream(wrapper, pool),
new NioServletOutputStream(wrapper, asyncWriteBufferSize, pool));
wrapper.setTimeout(INFINITE_TIMEOUT);
}
示例4: release
import org.apache.tomcat.util.net.SocketWrapper; //导入方法依赖的package包/类
/**
* Expected to be used by the handler once the processor is no longer
* required.
*
* @param socket
* @param processor
* @param isSocketClosing Not used in HTTP
* @param addToPoller
*/
@Override
public void release(SocketWrapper<NioChannel> socket,
Processor<NioChannel> processor, boolean isSocketClosing,
boolean addToPoller) {
processor.recycle(isSocketClosing);
recycledProcessors.offer(processor);
if (addToPoller) {
// The only time this method is called with addToPoller == true
// is when the socket is in keep-alive so set the appropriate
// timeout.
socket.setTimeout(getProtocol().getKeepAliveTimeout());
socket.getSocket().getPoller().add(socket.getSocket());
}
}
示例5: release
import org.apache.tomcat.util.net.SocketWrapper; //导入方法依赖的package包/类
/**
* Expected to be used by the handler once the processor is no longer
* required.
*/
@Override
public void release(SocketWrapper<NioChannel> socket, Processor<NioChannel> processor, boolean isSocketClosing,
boolean addToPoller) {
processor.recycle(isSocketClosing);
recycledProcessors.offer(processor);
if (addToPoller) {
// The only time this method is called with addToPoller == true
// is when the socket is in keep-alive so set the appropriate
// timeout.
socket.setTimeout(getProtocol().getKeepAliveTimeout());
socket.getSocket().getPoller().add(socket.getSocket());
}
}
示例6: UpgradeNioProcessor
import org.apache.tomcat.util.net.SocketWrapper; //导入方法依赖的package包/类
public UpgradeNioProcessor(SocketWrapper<NioChannel> wrapper, UpgradeInbound upgradeInbound, NioSelectorPool pool) {
super(upgradeInbound);
wrapper.setTimeout(upgradeInbound.getReadTimeout());
this.nioChannel = wrapper.getSocket();
this.pool = pool;
this.maxRead = nioChannel.getBufHandler().getReadBuffer().capacity();
this.maxWrite = nioChannel.getBufHandler().getWriteBuffer().capacity();
}
示例7: NioProcessor
import org.apache.tomcat.util.net.SocketWrapper; //导入方法依赖的package包/类
public NioProcessor(SocketWrapper<NioChannel> wrapper, HttpUpgradeHandler httpUpgradeProcessor,
NioSelectorPool pool, int asyncWriteBufferSize) {
super(httpUpgradeProcessor, new NioServletInputStream(wrapper, pool),
new NioServletOutputStream(wrapper, asyncWriteBufferSize, pool));
wrapper.setTimeout(INFINITE_TIMEOUT);
}
示例8: release
import org.apache.tomcat.util.net.SocketWrapper; //导入方法依赖的package包/类
/**
* Expected to be used by the handler once the processor is no longer
* required.
*
* @param socket
* @param processor
* @param isSocketClosing
* Not used in HTTP
* @param addToPoller
*/
@Override
public void release(SocketWrapper<NioChannel> socket, Processor<NioChannel> processor, boolean isSocketClosing,
boolean addToPoller) {
processor.recycle(isSocketClosing);
recycledProcessors.offer(processor);
if (addToPoller) {
// The only time this method is called with addToPoller == true
// is when the socket is in keep-alive so set the appropriate
// timeout.
socket.setTimeout(getProtocol().getKeepAliveTimeout());
socket.getSocket().getPoller().add(socket.getSocket());
}
}