public override void OnPreAdd(IoFilterChain parent, String name, INextFilter nextFilter) { if (parent.Contains<SslFilter>()) throw new InvalidOperationException("Only one SSL filter is permitted in a chain."); IoSession session = parent.Session; session.SetAttribute(NEXT_FILTER, nextFilter); // Create a SSL handler and start handshake. SslHandler handler = new SslHandler(this, session); session.SetAttribute(SSL_HANDLER, handler); }
public IoSessionStream(SslHandler sslHandler) { _sslHandler = sslHandler; _buf = IoBuffer.Allocate(16); _buf.AutoExpand = true; _buf.Limit = 0; }
private IWriteFuture InitiateClosure(SslHandler handler, INextFilter nextFilter, IoSession session) { IWriteFuture future = DefaultWriteFuture.NewWrittenFuture(session); handler.Destroy(); return future; }