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

Function getConnInternal

pkg/remote/conncontroller/conncontroller.go:1067–1083  ·  view source on GitHub ↗
(opts *remote.SSHOpts, createIfNotExists bool)

Source from the content-addressed store, hash-verified

1065}
1066
1067func getConnInternal(opts *remote.SSHOpts, createIfNotExists bool) *SSHConn {
1068 globalLock.Lock()
1069 defer globalLock.Unlock()
1070 rtn := clientControllerMap[*opts]
1071 if rtn == nil && createIfNotExists {
1072 rtn = &SSHConn{
1073 lock: &sync.Mutex{},
1074 lifecycleLock: &sync.Mutex{},
1075 Status: Status_Init,
1076 ConnHealthStatus: ConnHealthStatus_Good,
1077 WshEnabled: &atomic.Bool{},
1078 Opts: opts,
1079 }
1080 clientControllerMap[*opts] = rtn
1081 }
1082 return rtn
1083}
1084
1085// does NOT connect, does not return nil
1086func GetConn(opts *remote.SSHOpts) *SSHConn {

Callers 4

GetConnFunction · 0.70
MaybeGetConnFunction · 0.70
IsConnectedFunction · 0.70
DisconnectClientFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected