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

Method runIdleGCLoop

internal/exit/exit.go:874–885  ·  view source on GitHub ↗

runIdleGCLoop periodically scans for orphaned sessions and force-closes them. Returns when ctx is canceled.

(ctx context.Context)

Source from the content-addressed store, hash-verified

872// runIdleGCLoop periodically scans for orphaned sessions and force-closes
873// them. Returns when ctx is canceled.
874func (s *Server) runIdleGCLoop(ctx context.Context) {
875 t := time.NewTicker(idleGCInterval)
876 defer t.Stop()
877 for {
878 select {
879 case <-ctx.Done():
880 return
881 case <-t.C:
882 s.gcIdleSessions()
883 }
884 }
885}
886
887// kick wakes the long-poll handler currently serving owner so it drains
888// pending TX frames immediately. A non-blocking send keeps repeated kicks

Callers 1

ListenAndServeMethod · 0.95

Calls 2

gcIdleSessionsMethod · 0.95
StopMethod · 0.45

Tested by

no test coverage detected