本文整理汇总了Java中org.apache.tomcat.util.net.SocketWrapper类的典型用法代码示例。如果您正苦于以下问题:Java SocketWrapper类的具体用法?Java SocketWrapper怎么用?Java SocketWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SocketWrapper类属于org.apache.tomcat.util.net包,在下文中一共展示了SocketWrapper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
@Override
public void init(SocketWrapper<Long> socketWrapper,
AbstractEndpoint<Long> endpoint) throws IOException {
socket = socketWrapper.getSocket().longValue();
Socket.setsbb(this.socket, bbuf);
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:8,代码来源:InternalAprOutputBuffer.java
示例2: createUpgradeProcessor
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
@Override
protected Processor<Long> createUpgradeProcessor(
SocketWrapper<Long> socket,
HttpUpgradeHandler httpUpgradeProcessor)
throws IOException {
return new AprProcessor(socket, httpUpgradeProcessor,
(AprEndpoint) proto.endpoint,
proto.getUpgradeAsyncWriteBufferSize());
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:10,代码来源:Http11AprProtocol.java
示例3: setCometTimeouts
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
@Override
protected void setCometTimeouts(SocketWrapper<NioChannel> socketWrapper) {
// Comet support
SelectionKey key = socketWrapper.getSocket().getIOChannel()
.keyFor(socketWrapper.getSocket().getPoller().getSelector());
if (key != null) {
NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment) key.attachment();
if (attach != null) {
attach.setComet(comet);
if (comet) {
Integer comettimeout = (Integer) request
.getAttribute(org.apache.coyote.Constants.COMET_TIMEOUT_ATTR);
if (comettimeout != null) {
attach.setTimeout(comettimeout.longValue());
}
}
}
}
}
开发者ID:how2j,项目名称:lazycat,代码行数:20,代码来源:Http11NioProcessor.java
示例4: createUpgradeProcessor
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
/**
* @deprecated Will be removed in Tomcat 8.0.x.
*/
@Deprecated
@Override
protected P createUpgradeProcessor(SocketWrapper<S> socket,
org.apache.coyote.http11.upgrade.UpgradeInbound inbound) {
// TODO should fail - throw IOE
return null;
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:11,代码来源:AbstractAjpProtocol.java
示例5: BioProcessor
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
public BioProcessor(SocketWrapper<Socket> wrapper, HttpUpgradeHandler httpUpgradeProcessor,
int asyncWriteBufferSize) throws IOException {
super(httpUpgradeProcessor, new BioServletInputStream(wrapper),
new BioServletOutputStream(wrapper, asyncWriteBufferSize));
wrapper.getSocket().setSoTimeout(INFINITE_TIMEOUT);
}
开发者ID:how2j,项目名称:lazycat,代码行数:8,代码来源:BioProcessor.java
示例6: 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());
}
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:19,代码来源:AjpNioProtocol.java
示例7: 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<Long> socket,
Processor<Long> processor, boolean isSocketClosing,
boolean addToPoller) {
processor.recycle(isSocketClosing);
recycledProcessors.offer(processor);
if (addToPoller) {
((AprEndpoint)proto.endpoint).getPoller().add(
socket.getSocket().longValue(),
proto.endpoint.getKeepAliveTimeout(),
true, false);
}
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:18,代码来源:AjpAprProtocol.java
示例8: AprProcessor
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
public AprProcessor(SocketWrapper<Long> wrapper, HttpUpgradeHandler httpUpgradeProcessor, AprEndpoint endpoint,
int asyncWriteBufferSize) {
super(httpUpgradeProcessor, new AprServletInputStream(wrapper),
new AprServletOutputStream(wrapper, asyncWriteBufferSize, endpoint));
Socket.timeoutSet(wrapper.getSocket().longValue(), INFINITE_TIMEOUT);
}
开发者ID:how2j,项目名称:lazycat,代码行数:8,代码来源:AprProcessor.java
示例9: 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());
}
}
开发者ID:how2j,项目名称:lazycat,代码行数:18,代码来源:AjpNioProtocol.java
示例10: 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();
}
开发者ID:how2j,项目名称:lazycat,代码行数:11,代码来源:UpgradeNioProcessor.java
示例11: UpgradeAprProcessor
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
public UpgradeAprProcessor(SocketWrapper<Long> wrapper,
UpgradeInbound upgradeInbound) {
super(upgradeInbound);
Socket.timeoutSet(wrapper.getSocket().longValue(),
upgradeInbound.getReadTimeout());
this.socket = wrapper.getSocket().longValue();
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:10,代码来源:UpgradeAprProcessor.java
示例12: UpgradeBioProcessor
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
public UpgradeBioProcessor(SocketWrapper<Socket> wrapper, UpgradeInbound upgradeInbound) throws IOException {
super(upgradeInbound);
int timeout = upgradeInbound.getReadTimeout();
if (timeout < 0) {
timeout = 0;
}
wrapper.getSocket().setSoTimeout(timeout);
this.inputStream = wrapper.getSocket().getInputStream();
this.outputStream = wrapper.getSocket().getOutputStream();
}
开发者ID:how2j,项目名称:lazycat,代码行数:13,代码来源:UpgradeBioProcessor.java
示例13: AprServletOutputStream
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
public AprServletOutputStream(SocketWrapper<Long> wrapper,
int asyncWriteBufferSize, AprEndpoint endpoint) {
super(asyncWriteBufferSize);
this.endpoint = endpoint;
this.wrapper = wrapper;
this.socket = wrapper.getSocket().longValue();
if (endpoint.isSSLEnabled()) {
sslOutputBuffer = ByteBuffer.allocateDirect(SSL_OUTPUT_BUFFER_SIZE);
sslOutputBuffer.position(SSL_OUTPUT_BUFFER_SIZE);
} else {
sslOutputBuffer = null;
}
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:14,代码来源:AprServletOutputStream.java
示例14: UpgradeBioProcessor
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
public UpgradeBioProcessor(SocketWrapper<Socket> wrapper,
UpgradeInbound upgradeInbound) throws IOException {
super(upgradeInbound);
int timeout = upgradeInbound.getReadTimeout();
if (timeout < 0) {
timeout = 0;
}
wrapper.getSocket().setSoTimeout(timeout);
this.inputStream = wrapper.getSocket().getInputStream();
this.outputStream = wrapper.getSocket().getOutputStream();
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:14,代码来源:UpgradeBioProcessor.java
示例15: release
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
/**
* Expected to be used by the Poller to release resources on socket
* close, errors etc.
*/
@Override
public void release(SocketWrapper<NioChannel> socket) {
Processor<NioChannel> processor =
connections.remove(socket.getSocket());
if (processor != null) {
processor.recycle(true);
if (!processor.isUpgrade()) {
recycledProcessors.offer(processor);
}
}
}
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:16,代码来源:Http11NioProtocol.java
示例16: init
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
@Override
protected void init(SocketWrapper<NioChannel> socketWrapper,
AbstractEndpoint<NioChannel> endpoint) throws IOException {
socket = socketWrapper.getSocket();
socketReadBufferSize =
socket.getBufHandler().getReadBuffer().capacity();
int bufLength = headerBufferSize + socketReadBufferSize;
if (buf == null || buf.length < bufLength) {
buf = new byte[bufLength];
}
pool = ((NioEndpoint)endpoint).getSelectorPool();
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:16,代码来源:InternalNioInputBuffer.java
示例17: 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());
}
}
开发者ID:how2j,项目名称:lazycat,代码行数:24,代码来源:Http11NioProtocol.java
示例18: init
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
@Override
protected void init(SocketWrapper<Long> socketWrapper, AbstractEndpoint<Long> endpoint) throws IOException {
wrapper = socketWrapper;
socket = socketWrapper.getSocket().longValue();
Socket.setrbb(this.socket, bbuf);
}
开发者ID:how2j,项目名称:lazycat,代码行数:8,代码来源:InternalAprInputBuffer.java
示例19: createUpgradeProcessor
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
/**
* @deprecated Will be removed in Tomcat 8.0.x.
*/
@Deprecated
@Override
protected Processor<Socket> createUpgradeProcessor(SocketWrapper<Socket> socket,
org.apache.coyote.http11.upgrade.UpgradeInbound inbound) throws IOException {
return new org.apache.coyote.http11.upgrade.UpgradeBioProcessor(socket, inbound);
}
开发者ID:how2j,项目名称:lazycat,代码行数:10,代码来源:Http11Protocol.java
示例20: init
import org.apache.tomcat.util.net.SocketWrapper; //导入依赖的package包/类
@Override
public void init(SocketWrapper<NioChannel> socketWrapper, AbstractEndpoint<NioChannel> endpoint)
throws IOException {
socket = socketWrapper.getSocket();
pool = ((NioEndpoint) endpoint).getSelectorPool();
}
开发者ID:how2j,项目名称:lazycat,代码行数:8,代码来源:InternalNioOutputBuffer.java
注:本文中的org.apache.tomcat.util.net.SocketWrapper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论