MCPcopy
hub / github.com/wavetermdev/waveterm / Close

Method Close

pkg/remote/conncontroller/conncontroller.go:184–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

182}
183
184func (conn *SSHConn) Close() error {
185 conn.lifecycleLock.Lock()
186 defer conn.lifecycleLock.Unlock()
187
188 defer conn.FireConnChangeEvent()
189 conn.WithLock(func() {
190 if conn.Status == Status_Connected || conn.Status == Status_Connecting {
191 // if status is init, disconnected, or error don't change it
192 conn.Status = Status_Disconnected
193 }
194 })
195 conn.closeInternal_withlifecyclelock()
196 return nil
197}
198
199func (conn *SSHConn) closeInternal_withlifecyclelock() {
200 // does not set status (that should happen at another level)

Callers

nothing calls this directly

Calls 3

FireConnChangeEventMethod · 0.95
WithLockMethod · 0.95

Tested by

no test coverage detected