runIdleGCLoop periodically scans for orphaned sessions and force-closes them. Returns when ctx is canceled.
(ctx context.Context)
| 872 | // runIdleGCLoop periodically scans for orphaned sessions and force-closes |
| 873 | // them. Returns when ctx is canceled. |
| 874 | func (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 |
no test coverage detected