Java 类io.netty.channel.PendingWriteQueue 实例源码

项目:netty4.0.27Learn    文件:SslHandler.java   
@Override
public void handlerAdded(final ChannelHandlerContext ctx) throws Exception {
    this.ctx = ctx;
    pendingUnencryptedWrites = new PendingWriteQueue(ctx);

    if (ctx.channel().isActive() && engine.getUseClientMode()) {
        // Begin the initial handshake.
        // channelActive() event has been fired already, which means this.channelActive() will
        // not be invoked. We have to initialize here instead.
        handshake(null);
    } else {
        // channelActive() event has not been fired yet.  this.channelOpen() will be invoked
        // and initialization will occur there.
    }
}
项目:divconq    文件:SslHandler.java   
@Override
public void handlerAdded(final ChannelHandlerContext ctx) throws Exception {
    this.ctx = ctx;
    pendingUnencryptedWrites = new PendingWriteQueue(ctx);

    if (ctx.channel().isActive() && engine.getUseClientMode()) {
        // channelActive() event has been fired already, which means this.channelActive() will
        // not be invoked. We have to initialize here instead.
        handshake();
    } else {
        // channelActive() event has not been fired yet.  this.channelOpen() will be invoked
        // and initialization will occur there.
    }
}