Close waits for all reconnecting-pty WebSocket connections to drain before returning.
()
| 137 | // Close waits for all reconnecting-pty WebSocket connections to drain before |
| 138 | // returning. |
| 139 | func (s *Server) Close() error { |
| 140 | s.websocketWaitMutex.Lock() |
| 141 | s.websocketWaitGroup.Wait() |
| 142 | s.websocketWaitMutex.Unlock() |
| 143 | |
| 144 | if s.StatsCollector != nil { |
| 145 | _ = s.StatsCollector.Close() |
| 146 | } |
| 147 | |
| 148 | // The caller must close the SignedTokenProvider and the AgentProvider (if |
| 149 | // necessary). |
| 150 | |
| 151 | return nil |
| 152 | } |
| 153 | |
| 154 | func (s *Server) Attach(r chi.Router) { |
| 155 | servePathApps := func(r chi.Router) { |