MCPcopy Create free account
hub / github.com/PasarGuard/node / Disconnect

Method Disconnect

controller/controller.go:69–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67}
68
69func (c *Controller) Disconnect() {
70 c.cancelFunc()
71
72 c.mu.Lock()
73 backend := c.backend
74 c.mu.Unlock()
75
76 // Shutdown backend outside of lock to avoid deadlock
77 // Shutdown() will wait for process termination to complete
78 if backend != nil {
79 backend.Shutdown()
80 }
81
82 c.mu.Lock()
83 defer c.mu.Unlock()
84
85 c.backend = nil
86 c.apiPort = netutil.FindFreePort()
87 c.metricPort = netutil.FindFreePort()
88 c.clientIP = ""
89}
90
91func (c *Controller) Ip() string {
92 c.mu.RLock()

Callers 1

keepAliveTrackerMethod · 0.95

Calls 2

FindFreePortFunction · 0.92
ShutdownMethod · 0.65

Tested by

no test coverage detected