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

Function MakeConnMonitor

pkg/remote/conncontroller/connmonitor.go:33–51  ·  view source on GitHub ↗
(conn *SSHConn, client *ssh.Client)

Source from the content-addressed store, hash-verified

31}
32
33func MakeConnMonitor(conn *SSHConn, client *ssh.Client) *ConnMonitor {
34 if conn == nil {
35 panic("conn cannot be nil")
36 }
37 if client == nil {
38 panic("client cannot be nil")
39 }
40 ctx, cancelFunc := context.WithCancel(context.Background())
41 cm := &ConnMonitor{
42 lock: &sync.Mutex{},
43 Conn: conn,
44 Client: client,
45 ctx: ctx,
46 cancelFunc: cancelFunc,
47 inputNotifyCh: make(chan int64, 1),
48 }
49 go cm.keepAliveMonitor()
50 return cm
51}
52
53// setConnHealthStatus calls into SSHConn.SetConnHealthStatus
54// CRITICAL: cm.lock must NOT be held when calling this method (violates lock ordering)

Callers 1

connectInternalMethod · 0.85

Calls 1

keepAliveMonitorMethod · 0.95

Tested by

no test coverage detected