Examples of shutdownWrites()


Examples of io.undertow.protocols.ajp.AjpClientRequestClientStreamSinkChannel.shutdownWrites()

        AjpClientExchange.invokeReadReadyCallback(AjpClientExchange);
        if (length == 0) {
            //if there is no content we flush the response channel.
            //otherwise it is up to the user
            try {
                sinkChannel.shutdownWrites();
                if (!sinkChannel.flush()) {
                    handleFailedFlush(sinkChannel);
                }
            } catch (IOException e) {
                handleError(e);
View Full Code Here

Examples of io.undertow.protocols.http2.Http2HeadersStreamSinkChannel.shutdownWrites()

        }
        if (!hasContent) {
            //if there is no content we flush the response channel.
            //otherwise it is up to the user
            try {
                sinkChannel.shutdownWrites();
                if (!sinkChannel.flush()) {
                    sinkChannel.getWriteSetter().set(ChannelListeners.flushingChannelListener(null, new ChannelExceptionHandler<StreamSinkChannel>() {
                        @Override
                        public void handleException(StreamSinkChannel channel, IOException exception) {
                            handleError(exception);
View Full Code Here

Examples of io.undertow.protocols.spdy.SpdySynStreamStreamSinkChannel.shutdownWrites()

        }
        if (!hasContent) {
            //if there is no content we flush the response channel.
            //otherwise it is up to the user
            try {
                sinkChannel.shutdownWrites();
                if (!sinkChannel.flush()) {
                    sinkChannel.getWriteSetter().set(ChannelListeners.flushingChannelListener(null, new ChannelExceptionHandler<StreamSinkChannel>() {
                        @Override
                        public void handleException(StreamSinkChannel channel, IOException exception) {
                            handleError(exception);
View Full Code Here

Examples of io.undertow.spdy.SpdySynStreamStreamSinkChannel.shutdownWrites()

        }
        if (!hasContent) {
            //if there is no content we flush the response channel.
            //otherwise it is up to the user
            try {
                sinkChannel.shutdownWrites();
                if (!sinkChannel.flush()) {
                    sinkChannel.getWriteSetter().set(ChannelListeners.flushingChannelListener(null, new ChannelExceptionHandler<StreamSinkChannel>() {
                        @Override
                        public void handleException(StreamSinkChannel channel, IOException exception) {
                            handleError(exception);
View Full Code Here

Examples of io.undertow.spdy.SpdySynStreamStreamSinkChannel.shutdownWrites()

        }
        if (!hasContent) {
            //if there is no content we flush the response channel.
            //otherwise it is up to the user
            try {
                sinkChannel.shutdownWrites();
                if (!sinkChannel.flush()) {
                    sinkChannel.getWriteSetter().set(ChannelListeners.flushingChannelListener(null, new ChannelExceptionHandler<StreamSinkChannel>() {
                        @Override
                        public void handleException(StreamSinkChannel channel, IOException exception) {
                            handleError(exception);
View Full Code Here

Examples of io.undertow.websockets.core.StreamSinkFrameChannel.shutdownWrites()

                            StreamSinkFrameChannel sink = channel.send(WebSocketFrameType.BINARY, buf.remaining());
                            Assert.assertEquals(WebSocketFrameType.BINARY, sink.getType());
                            while (buf.hasRemaining()) {
                                sink.write(buf);
                            }
                            sink.shutdownWrites();
                            if(!sink.flush()) {
                                sink.getWriteSetter().set(ChannelListeners.flushingChannelListener(null, null));
                                sink.resumeWrites();
                            }
                            channel.sendClose();
View Full Code Here

Examples of org.xnio.channels.StreamSinkChannel.shutdownWrites()

                    channel = servletRequestContext.getExchange().getResponseChannel();
                }
                state |= FLAG_DELEGATE_SHUTDOWN;
                StreamSinkChannel channel = this.channel;
                if(channel != null) { //mock requests
                    channel.shutdownWrites();
                    Channels.flushBlocking(channel);
                }
            } finally {
                if (pooledBuffer != null) {
                    pooledBuffer.free();
View Full Code Here

Examples of org.xnio.channels.StreamSinkChannel.shutdownWrites()

                }
                if (res == -1) {
                    try {
                        channel.shutdownReads();
                        final StreamSinkChannel responseChannel = connection.getChannel().getSinkChannel();
                        responseChannel.shutdownWrites();
                        // will return false if there's a response queued ahead of this one, so we'll set up a listener then
                        if (!responseChannel.flush()) {
                            responseChannel.getWriteSetter().set(ChannelListeners.flushingChannelListener(null, null));
                            responseChannel.resumeWrites();
                        }
View Full Code Here

Examples of org.xnio.channels.StreamSinkChannel.shutdownWrites()

                    } else if (res == -1) {
                        try {
                            channel.suspendReads();
                            channel.shutdownReads();
                            final StreamSinkChannel requestChannel = underlyingChannel;
                            requestChannel.shutdownWrites();
                            // will return false if there's a response queued ahead of this one, so we'll set up a listener then
                            if (!requestChannel.flush()) {
                                requestChannel.getWriteSetter().set(ChannelListeners.flushingChannelListener(null, null));
                                requestChannel.resumeWrites();
                            }
View Full Code Here

Examples of org.xnio.channels.StreamSinkChannel.shutdownWrites()

        StreamSinkChannel sink = createSink(payload.remaining());
        BlockingWritableByteChannel channel = new BlockingWritableByteChannel(sink);
        while(payload.hasRemaining()) {
            channel.write(payload);
        }
        sink.shutdownWrites();
        channel.flush();
        channel.close();
    }

    @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.