当前位置: 首页>>代码示例>>Java>>正文


Java SslConnection类代码示例

本文整理汇总了Java中org.eclipse.jetty.io.nio.SslConnection的典型用法代码示例。如果您正苦于以下问题:Java SslConnection类的具体用法?Java SslConnection怎么用?Java SslConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SslConnection类属于org.eclipse.jetty.io.nio包,在下文中一共展示了SslConnection类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newEndPoint

import org.eclipse.jetty.io.nio.SslConnection; //导入依赖的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: newConnection

import org.eclipse.jetty.io.nio.SslConnection; //导入依赖的package包/类
@Override
protected AsyncConnection newConnection(SocketChannel channel,final AsyncEndPoint endpoint)
{
    AsyncHttpConnection conn = (AsyncHttpConnection)((SslConnection)super.newConnection(channel, endpoint)).getSslEndPoint().getConnection();
    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

示例3: connectionClosed

import org.eclipse.jetty.io.nio.SslConnection; //导入依赖的package包/类
@Override  
protected void connectionClosed (Connection connection) {
    if (connection instanceof SslConnection) {
        AsyncHttpConnection conn = (AsyncHttpConnection)((SslConnection) connection).getSslEndPoint().getConnection();
        ServerSessionMonitor monitor = (ServerSessionMonitor)conn.getAssociatedObject();
        if (monitor != null) {
            monitorService.deregisterSessionMonitor(monitor, session);
            conn.setAssociatedObject(null);
        }
    }
    super.connectionClosed(connection);
}
 
开发者ID:jaytaylor,项目名称:sql-layer,代码行数:13,代码来源:HttpConductorImpl.java


注:本文中的org.eclipse.jetty.io.nio.SslConnection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。