public HttpServerConnection( StreamConnection channel, final Pool<ByteBuffer> bufferPool, final HttpHandler rootHandler, final OptionMap undertowOptions, final int bufferSize) { this.channel = channel; this.bufferPool = bufferPool; this.rootHandler = rootHandler; this.undertowOptions = undertowOptions; this.bufferSize = bufferSize; closeSetter = ChannelListeners.getDelegatingSetter(channel.getCloseSetter(), this); this.originalSinkConduit = channel.getSinkChannel().getConduit(); this.originalSourceConduit = channel.getSourceChannel().getConduit(); }
HttpClientConnection( final StreamConnection connection, final OptionMap options, final Pool<ByteBuffer> bufferPool) { this.options = options; this.connection = connection; this.pushBackStreamSourceConduit = new PushBackStreamSourceConduit(connection.getSourceChannel().getConduit()); this.connection.getSourceChannel().setConduit(pushBackStreamSourceConduit); this.bufferPool = bufferPool; this.originalSinkConduit = connection.getSinkChannel().getConduit(); connection .getCloseSetter() .set( new ChannelListener<StreamConnection>() { public void handleEvent(StreamConnection channel) { HttpClientConnection.this.state |= CLOSED; ChannelListeners.invokeChannelListener( HttpClientConnection.this, closeSetter.get()); } }); }