MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / ConnMonitor

Struct ConnMonitor

pkg/remote/conncontroller/connmonitor.go:20–31  ·  view source on GitHub ↗

Lock ordering: conn.lock > cm.lock (conn.lock is outer, cm.lock is inner) CRITICAL: Methods that hold cm.lock must NEVER call into SSHConn (deadlock - violates ordering). Methods called from SSHConn while conn.lock is held should avoid acquiring cm.lock (keep locking simple).

Source from the content-addressed store, hash-verified

18// CRITICAL: Methods that hold cm.lock must NEVER call into SSHConn (deadlock - violates ordering).
19// Methods called from SSHConn while conn.lock is held should avoid acquiring cm.lock (keep locking simple).
20type ConnMonitor struct {
21 lock *sync.Mutex
22 Conn *SSHConn // always non-nil, set at creation
23 Client *ssh.Client // always non-nil, set at creation
24 LastActivityTime atomic.Int64
25 LastInputTime atomic.Int64
26 KeepAliveSentTime atomic.Int64
27 KeepAliveInFlight bool
28 ctx context.Context
29 cancelFunc context.CancelFunc
30 inputNotifyCh chan int64
31}
32
33func MakeConnMonitor(conn *SSHConn, client *ssh.Client) *ConnMonitor {
34 if conn == nil {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected