final void flushQueries() { ch.flush(); }
@Override public void flush() throws IOException { ctx.flush(); }
@Override public void operationComplete(ChannelFuture future) throws Exception { future.channel().flush(); } };
@Override public ChannelGroup flush(ChannelMatcher matcher) { for (Channel c: nonServerChannels.values()) { if (matcher.matches(c)) { c.flush(); } } return this; }
private void flushChannel() { while (needChannelFlush.getAndSet(false)) { channel.flush(); } }
@Override public ChannelGroup flush(ChannelMatcher matcher) { for (Channel c: nonServerChannels.values()) { if (matcher.matches(c)) { c.flush(); } } return this; }
@Override public final void checkFlushBatchBuffer() { if (this.batchingEnabled) { //perform the flush only if necessary final int batchBufferSize = batchBufferSize(this.channel, this.writeBufferHighWaterMark); if (batchBufferSize > 0) { this.channel.flush(); } } }
@Override public ChannelGroup flush(ChannelMatcher matcher) { for (Channel c: nonServerChannels.values()) { if (matcher.matches(c)) { c.flush(); } } return this; }
private void _writePing(long data, ChannelPromise promise) { encoder().writePing(chctx, false, data, promise); chctx.channel().flush(); }
private void http2Connected(ConnectionListener<HttpClientConnection> listener, ContextInternal context, Channel ch, Future<ConnectResult<HttpClientConnection>> future) { try { VertxHttp2ConnectionHandler<Http2ClientConnection> clientHandler = Http2ClientConnection.createHttp2ConnectionHandler(client, endpointMetric, listener, context, null, (conn, concurrency) -> { future.complete(new ConnectResult<>(conn, concurrency, http2Weight)); }); ch.pipeline().addLast("handler", clientHandler); ch.flush(); } catch (Exception e) { connectFailed(ch, listener, e, future); } }
private ChannelFuture sendPkt(Packet p, boolean doFlush) { // Assuming the packet will be sent out successfully. Because if it fails, // the channel will close and clean up queues. p.createBB(); updateLastSend(); ChannelFuture result = channel.write(Unpooled.wrappedBuffer(p.bb)); result.addListener(f -> { if (f.isSuccess()) { sentCount.getAndIncrement(); } }); if (doFlush) { channel.flush(); } return result; }
void sendPacket(byte[] wire, InetSocketAddress address) { DatagramPacket packet = new DatagramPacket(Unpooled.copiedBuffer(wire), address); channel.write(packet); channel.flush(); }
private void channelFlush() { if (debugEnabled) { logger.debug("{} write() channelFlush", logPrefix()); } channel.flush(); }
/** * Consume {@code numBytes} for {@code stream} in the flow controller, this must be called from event loop. */ void consume(Http2Stream stream, int numBytes) { try { boolean windowUpdateSent = decoder().flowController().consumeBytes(stream, numBytes); if (windowUpdateSent) { chctx.channel().flush(); } } catch (Http2Exception e) { onError(chctx, true, e); } }
protected int sendHttpRequest(FullHttpRequest httpRequest, AbstractHttpClientHandler callback) { final int requestId = streamId.getAndAdd(2); Channel channel = this.channel.channel(); responseChannelHandler.put(requestId, channel.write(httpRequest), callback); channel.flush(); return requestId; }
protected int sendHttpRequest(FullHttpRequest httpRequest, AbstractHttpClientHandler callback) { final int requestId = streamId.getAndAdd(2); Channel channel = this.channel.channel(); responseChannelHandler.put(requestId, channel.write(httpRequest), callback); channel.flush(); return requestId; }
private void _flushInEventloop(long startTimeNanos) { assert nettyChannel.eventLoop().inEventLoop(); nettyChannel.flush(); // Flush is sync when from eventloop. eventListener.onFlushComplete(Clock.onEndNanos(startTimeNanos), NANOSECONDS); }
private void _writeData(Http2Stream stream, ByteBuf chunk, boolean end, ChannelPromise promise) { encoder().writeData(chctx, stream.id(), chunk, 0, end, promise); Http2RemoteFlowController controller = encoder().flowController(); if (!controller.isWritable(stream) || end) { try { encoder().flowController().writePendingBytes(); } catch (Http2Exception e) { onError(chctx, true, e); } } chctx.channel().flush(); }
private void writeClientRequestToOrigin(final PooledConnection conn) { final Channel ch = conn.getChannel(); passport.setOnChannel(ch); context.set(ORIGIN_CHANNEL, ch); context.set(POOLED_ORIGIN_CONNECTION_KEY, conn); preWriteToOrigin(chosenServer.get(), zuulRequest); final ChannelPipeline pipeline = ch.pipeline(); originResponseReceiver = getOriginResponseReceiver(); pipeline.addBefore("connectionPoolHandler", OriginResponseReceiver.CHANNEL_HANDLER_NAME, originResponseReceiver); // check if body needs to be repopulated for retry repopulateRetryBody(); ch.write(zuulRequest); writeBufferedBodyContent(zuulRequest, ch); ch.flush(); //Get ready to read origin's response ch.read(); originConn = conn; channelCtx.read(); }
private void writeClientRequestToOrigin(final PooledConnection conn) { final Channel ch = conn.getChannel(); passport.setOnChannel(ch); context.set(ORIGIN_CHANNEL, ch); context.set(POOLED_ORIGIN_CONNECTION_KEY, conn); preWriteToOrigin(chosenServer.get(), zuulRequest); final ChannelPipeline pipeline = ch.pipeline(); originResponseReceiver = getOriginResponseReceiver(); pipeline.addBefore("connectionPoolHandler", OriginResponseReceiver.CHANNEL_HANDLER_NAME, originResponseReceiver); // check if body needs to be repopulated for retry repopulateRetryBody(); ch.write(zuulRequest); writeBufferedBodyContent(zuulRequest, ch); ch.flush(); //Get ready to read origin's response ch.read(); originConn = conn; channelCtx.read(); }