MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / Shutdown

Method Shutdown

internal/vnc/session_manager.go:166–190  ·  view source on GitHub ↗

Shutdown gracefully shuts down this VNC session, stopping the HTTP server and cleaning up all associated resources.

()

Source from the content-addressed store, hash-verified

164// Shutdown gracefully shuts down this VNC session, stopping the HTTP server
165// and cleaning up all associated resources.
166func (s *VNCSession) Shutdown() error {
167 s.mutex.Lock()
168 defer s.mutex.Unlock()
169
170 // Mark session as closed
171 s.State = SessionStateClosed
172
173 // Cancel the session context
174 if s.cancelFunc != nil {
175 s.cancelFunc()
176 }
177
178 // Close the disconnect channel
179 if s.disconnectChan != nil {
180 close(s.disconnectChan)
181 s.disconnectChan = nil
182 }
183
184 // Stop the HTTP server
185 if s.Server != nil {
186 return s.Server.Stop()
187 }
188
189 return nil
190}
191
192// SessionCountCallback is called when the session count changes.
193type SessionCountCallback func(count int)

Callers

nothing calls this directly

Calls 1

StopMethod · 0.45

Tested by

no test coverage detected