本文整理汇总了Java中org.eclipse.jetty.io.AsyncEndPoint类的典型用法代码示例。如果您正苦于以下问题:Java AsyncEndPoint类的具体用法?Java AsyncEndPoint怎么用?Java AsyncEndPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AsyncEndPoint类属于org.eclipse.jetty.io包,在下文中一共展示了AsyncEndPoint类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: newEndPoint
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
@Override
protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectSet selectSet, final SelectionKey key) throws IOException
{
WebSocketClient.WebSocketFuture holder = (WebSocketClient.WebSocketFuture)key.attachment();
int maxIdleTime = holder.getMaxIdleTime();
if (maxIdleTime < 0)
maxIdleTime = (int)getMaxIdleTime();
SelectChannelEndPoint result = new SelectChannelEndPoint(channel, selectSet, key, maxIdleTime);
AsyncEndPoint endPoint = result;
// Detect if it is SSL, and wrap the connection if so
if ("wss".equals(holder.getURI().getScheme()))
{
SSLEngine sslEngine = newSslEngine(channel);
SslConnection sslConnection = new SslConnection(sslEngine, endPoint);
endPoint.setConnection(sslConnection);
endPoint = sslConnection.getSslEndPoint();
}
AsyncConnection connection = selectSet.getManager().newConnection(channel, endPoint, holder);
endPoint.setConnection(connection);
return result;
}
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:25,代码来源:WebSocketClientFactory.java
示例2: checkWriteable
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
private void checkWriteable()
{
if (!_outbound.isBufferEmpty() && _endp instanceof AsyncEndPoint)
{
((AsyncEndPoint)_endp).scheduleWrite();
}
}
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:8,代码来源:WebSocketConnectionRFC6455.java
示例3: SslConnection
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
public SslConnection(SSLEngine engine,EndPoint endp, long timeStamp)
{
super(endp,timeStamp);
_engine=engine;
_session=_engine.getSession();
_aEndp=(AsyncEndPoint)endp;
_sslEndPoint = newSslEndPoint();
}
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:9,代码来源:SslConnection.java
示例4: newConnection
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
@Override
protected AsyncConnection newConnection(SocketChannel channel,final AsyncEndPoint endpoint)
{
AsyncHttpConnection conn = (AsyncHttpConnection)super.newConnection(channel, endpoint);
ServerSessionMonitor sessionMonitor = new ServerSessionMonitor(SERVER_TYPE,
monitorService.allocateSessionId());
conn.setAssociatedObject(sessionMonitor);
this.session = sessionService.createSession();
monitorService.registerSessionMonitor(sessionMonitor, session);
return conn;
}
开发者ID:jaytaylor,项目名称:sql-layer,代码行数:13,代码来源:HttpConductorImpl.java
示例5: newConnection
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
@Override
public AsyncConnection newConnection(SocketChannel channel, AsyncEndPoint endpoint, Object attachment)
{
WebSocketClient.WebSocketFuture holder = (WebSocketClient.WebSocketFuture)attachment;
return new HandshakeConnection(endpoint, holder);
}
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:7,代码来源:WebSocketClientFactory.java
示例6: handle
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
public Connection handle() throws IOException
{
Thread current = Thread.currentThread();
ClassLoader oldcontext = current.getContextClassLoader();
current.setContextClassLoader(_context);
try
{
// handle the framing protocol
boolean progress=true;
while (progress)
{
int flushed=_generator.flushBuffer();
int filled=_parser.parseNext();
progress = flushed>0 || filled>0;
_endp.flush();
if (_endp instanceof AsyncEndPoint && ((AsyncEndPoint)_endp).hasProgressed())
progress=true;
}
}
catch(IOException e)
{
try
{
if (_endp.isOpen())
_endp.close();
}
catch(IOException e2)
{
LOG.ignore(e2);
}
throw e;
}
finally
{
current.setContextClassLoader(oldcontext);
_parser.returnBuffer();
_generator.returnBuffer();
if (_endp.isOpen())
{
if (_closedIn && _closedOut && _outbound.isBufferEmpty())
_endp.close();
else if (_endp.isInputShutdown() && !_closedIn)
closeIn(CLOSE_NO_CLOSE,null);
else
checkWriteable();
}
}
return this;
}
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:53,代码来源:WebSocketConnectionRFC6455.java
示例7: getSslEndPoint
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
public AsyncEndPoint getSslEndPoint()
{
return _sslEndPoint;
}
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:5,代码来源:SslConnection.java
示例8: getEndpoint
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
public AsyncEndPoint getEndpoint()
{
return _aEndp;
}
开发者ID:itead,项目名称:IoTgo_Android_App,代码行数:5,代码来源:SslConnection.java
示例9: newConnection
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
public abstract AsyncConnection newConnection(SocketChannel channel, AsyncEndPoint endpoint, Object attachment);
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:2,代码来源:SelectorManager.java
注:本文中的org.eclipse.jetty.io.AsyncEndPoint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论