本文整理汇总了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;
}
示例2: checkWriteable
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
private void checkWriteable()
{
if (!_outbound.isBufferEmpty() && _endp instanceof AsyncEndPoint)
{
((AsyncEndPoint)_endp).scheduleWrite();
}
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
示例7: getSslEndPoint
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
public AsyncEndPoint getSslEndPoint()
{
return _sslEndPoint;
}
示例8: getEndpoint
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
public AsyncEndPoint getEndpoint()
{
return _aEndp;
}
示例9: newConnection
import org.eclipse.jetty.io.AsyncEndPoint; //导入依赖的package包/类
public abstract AsyncConnection newConnection(SocketChannel channel, AsyncEndPoint endpoint, Object attachment);