MCPcopy Create free account
hub / github.com/Hidden-Node/GooseRelayVPN-AndroidClient / coalesceDuration

Method coalesceDuration

internal/exit/exit.go:474–482  ·  view source on GitHub ↗

coalesceDuration picks the coalesce window for the current drain. Under high session fan-out we shrink the window: the next batch fills within a few ms anyway, and 25ms of extra accumulation per response just adds tail latency. Large batches (already half-full or more) keep the full 25ms because the

(currentFrames int)

Source from the content-addressed store, hash-verified

472// tail latency. Large batches (already half-full or more) keep the full
473// 25ms because they are bulk-dominant and benefit from extra throughput.
474func (s *Server) coalesceDuration(currentFrames int) time.Duration {
475 s.mu.Lock()
476 sessionCount := len(s.sessions)
477 s.mu.Unlock()
478 if sessionCount >= busySessionThreshold && currentFrames < maxDrainFramesPerBatch/2 {
479 return coalesceWindowBusy
480 }
481 return coalesceWindow
482}
483
484// routeIncoming routes one incoming frame to its session, creating the session
485// (and dialing upstream) if this is a SYN. owner is the clientID of the

Callers 1

handleTunnelMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected