millisBeforeDeadline() — netty Function Reference
Architecture documentation for the millisBeforeDeadline() function in NioIoHandler.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 430fa9ce_cc53_2a86_0feb_11916b32c02f["millisBeforeDeadline()"] db526e28_8aae_a182_b56b_dc12824d89f5["NioIoHandler"] 430fa9ce_cc53_2a86_0feb_11916b32c02f -->|defined in| db526e28_8aae_a182_b56b_dc12824d89f5 b18c5ab3_f5bb_81ad_70bd_20524d394f59["select()"] b18c5ab3_f5bb_81ad_70bd_20524d394f59 -->|calls| 430fa9ce_cc53_2a86_0feb_11916b32c02f style 430fa9ce_cc53_2a86_0feb_11916b32c02f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
transport/src/main/java/io/netty/channel/nio/NioIoHandler.java lines 724–734
private static long millisBeforeDeadline(long selectDeadLineNanos, long currentTimeNanos) {
assert selectDeadLineNanos != Long.MAX_VALUE;
long nanosBeforeDeadline = selectDeadLineNanos - currentTimeNanos;
// Prevent overflow when adding the rounding bias:
// if we don't do this, it would appear as the deadline is already reached!
if (nanosBeforeDeadline >= Long.MAX_VALUE - 500_000L) {
return Long.MAX_VALUE / 1_000_000L;
}
// Add 500_000 to round up to the nearest millisecond.
return (nanosBeforeDeadline + 500_000L) / 1_000_000L;
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does millisBeforeDeadline() do?
millisBeforeDeadline() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/nio/NioIoHandler.java.
Where is millisBeforeDeadline() defined?
millisBeforeDeadline() is defined in transport/src/main/java/io/netty/channel/nio/NioIoHandler.java at line 724.
What calls millisBeforeDeadline()?
millisBeforeDeadline() is called by 1 function(s): select.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free