Home / Function/ sendAllValid() — netty Function Reference

sendAllValid() — netty Function Reference

Architecture documentation for the sendAllValid() function in GlobalChannelTrafficShapingHandler.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  fdc8520e_a0b7_8af9_c2a9_1cedfe7a5952["sendAllValid()"]
  70857fc2_a134_e299_7b48_1738d53c0016["GlobalChannelTrafficShapingHandler"]
  fdc8520e_a0b7_8af9_c2a9_1cedfe7a5952 -->|defined in| 70857fc2_a134_e299_7b48_1738d53c0016
  e0808444_5985_0d26_adac_0697fe4d503a["submitWrite()"]
  e0808444_5985_0d26_adac_0697fe4d503a -->|calls| fdc8520e_a0b7_8af9_c2a9_1cedfe7a5952
  95f889b3_eae3_1bd8_4f15_602c55f0e60f["write()"]
  fdc8520e_a0b7_8af9_c2a9_1cedfe7a5952 -->|calls| 95f889b3_eae3_1bd8_4f15_602c55f0e60f
  style fdc8520e_a0b7_8af9_c2a9_1cedfe7a5952 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficShapingHandler.java lines 742–765

    private void sendAllValid(final ChannelHandlerContext ctx, final PerChannel perChannel, final long now) {
        // write operations need synchronization
        synchronized (perChannel) {
            ToSend newToSend = perChannel.messagesQueue.pollFirst();
            for (; newToSend != null; newToSend = perChannel.messagesQueue.pollFirst()) {
                if (newToSend.relativeTimeAction <= now) {
                    long size = newToSend.size;
                    trafficCounter.bytesRealWriteFlowControl(size);
                    perChannel.channelTrafficCounter.bytesRealWriteFlowControl(size);
                    perChannel.queueSize -= size;
                    queuesSize.addAndGet(-size);
                    ctx.write(newToSend.toSend, newToSend.promise);
                    perChannel.lastWriteTimestamp = now;
                } else {
                    perChannel.messagesQueue.addFirst(newToSend);
                    break;
                }
            }
            if (perChannel.messagesQueue.isEmpty()) {
                releaseWriteSuspended(ctx);
            }
        }
        ctx.flush();
    }

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does sendAllValid() do?
sendAllValid() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficShapingHandler.java.
Where is sendAllValid() defined?
sendAllValid() is defined in handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficShapingHandler.java at line 742.
What does sendAllValid() call?
sendAllValid() calls 1 function(s): write.
What calls sendAllValid()?
sendAllValid() is called by 1 function(s): submitWrite.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free