Examples of shutdownWrites()


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

                    } else if (res == -1 && !buffer.hasRemaining()) {
                        channel.suspendReads();
                        IoUtils.safeClose(AjpClientConnection.this);
                        try {
                            final StreamSinkChannel requestChannel = connection.getSinkChannel();
                            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()

                }
                if (res == -1) {
                    try {
                        channel.shutdownReads();
                        final StreamSinkChannel responseChannel = connection.getChannel().getSinkChannel();
                        responseChannel.shutdownWrites();
                        IoUtils.safeClose(connection);
                    } catch (IOException e) {
                        UndertowLogger.REQUEST_IO_LOGGER.ioException(e);
                        // fuck it, it's all ruined
                        IoUtils.safeClose(connection);
View Full Code Here

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

                }
                if (channel == null) {
                    channel = servletRequestContext.getExchange().getResponseChannel();
                }
                StreamSinkChannel channel = this.channel;
                channel.shutdownWrites();
                state |= FLAG_DELEGATE_SHUTDOWN;
                Channels.flushBlocking(channel);
            } finally {
                if (pooledBuffer != null) {
                    pooledBuffer.free();
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()

                    } else if (res == -1) {
                        channel.suspendReads();
                        IoUtils.safeClose(HttpClientConnection.this);
                        try {
                            final StreamSinkChannel requestChannel = connection.getSinkChannel();
                            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()

                    } else if (res == -1 && !buffer.hasRemaining()) {
                        channel.suspendReads();
                        safeClose(AjpClientConnection.this);
                        try {
                            final StreamSinkChannel requestChannel = connection.getSinkChannel();
                            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()

                }
                if (res == -1) {
                    try {
                        channel.shutdownReads();
                        final StreamSinkChannel responseChannel = connection.getChannel().getSinkChannel();
                        responseChannel.shutdownWrites();
                        safeClose(connection);
                    } catch (IOException e) {
                        UndertowLogger.REQUEST_IO_LOGGER.ioException(e);
                        // fuck it, it's all ruined
                        safeClose(connection);
View Full Code Here

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

                try {
                    log.tracef("Serving file %s (blocking)", fileChannel);
                    Channels.transferBlocking(response, fileChannel, 0, file.length());
                    log.tracef("Finished serving %s, shutting down (blocking)", fileChannel);
                    response.shutdownWrites();
                    log.tracef("Finished serving %s, flushing (blocking)", fileChannel);
                    Channels.flushBlocking(response);
                    log.tracef("Finished serving %s (complete)", fileChannel);
                    exchange.endExchange();
                } catch (IOException ignored) {
View Full Code Here

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

    private void handleConnectionClose(StreamSourceChannel channel) {
        try {
            channel.suspendReads();
            channel.shutdownReads();
            final StreamSinkChannel responseChannel = this.connection.getChannel().getSinkChannel();
            responseChannel.shutdownWrites();
            IoUtils.safeClose(connection);
        } catch (IOException e) {
            UndertowLogger.REQUEST_IO_LOGGER.debug("Error reading request", e);
            // fuck it, it's all ruined
            IoUtils.safeClose(connection);
View Full Code Here

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

                }
                if (channel == null) {
                    channel = servletResponse.getExchange().getResponseChannel();
                }
                StreamSinkChannel channel = this.channel;
                channel.shutdownWrites();
                state |= FLAG_DELEGATE_SHUTDOWN;
                Channels.flushBlocking(channel);
            } finally {
                if (pooledBuffer != null) {
                    pooledBuffer.free();
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.