()
| 182 | } |
| 183 | |
| 184 | func (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 | |
| 199 | func (conn *SSHConn) closeInternal_withlifecyclelock() { |
| 200 | // does not set status (that should happen at another level) |
nothing calls this directly
no test coverage detected