Search in sources :

Example 1 with SingleByteStreamSourceConduit

use of io.undertow.util.SingleByteStreamSourceConduit in project undertow by undertow-io.

the class DefaultServer method wrapOpenListener.

private static ChannelListener<StreamConnection> wrapOpenListener(final ChannelListener<StreamConnection> listener) {
    if (!single) {
        return listener;
    }
    return new ChannelListener<StreamConnection>() {

        @Override
        public void handleEvent(StreamConnection channel) {
            channel.getSinkChannel().setConduit(new SingleByteStreamSinkConduit(channel.getSinkChannel().getConduit(), 10000));
            channel.getSourceChannel().setConduit(new SingleByteStreamSourceConduit(channel.getSourceChannel().getConduit(), 10000));
            listener.handleEvent(channel);
        }
    };
}
Also used : SingleByteStreamSinkConduit(io.undertow.util.SingleByteStreamSinkConduit) ChannelListener(org.xnio.ChannelListener) StreamConnection(org.xnio.StreamConnection) SingleByteStreamSourceConduit(io.undertow.util.SingleByteStreamSourceConduit)

Aggregations

SingleByteStreamSinkConduit (io.undertow.util.SingleByteStreamSinkConduit)1 SingleByteStreamSourceConduit (io.undertow.util.SingleByteStreamSourceConduit)1 ChannelListener (org.xnio.ChannelListener)1 StreamConnection (org.xnio.StreamConnection)1