Shutdown terminates all active sessions.
()
| 181 | |
| 182 | // Shutdown terminates all active sessions. |
| 183 | func (srv *server) Shutdown() { |
| 184 | srv.mu.Lock() |
| 185 | srv.shutdownCalled = true |
| 186 | for c := range srv.activeConns { |
| 187 | c.Close() |
| 188 | } |
| 189 | srv.mu.Unlock() |
| 190 | srv.sessionWaitGroup.Wait() |
| 191 | } |
| 192 | |
| 193 | // OnPolicyChange terminates any active sessions that no longer match |
| 194 | // the SSH access policy. |