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

Function IsConnected

pkg/remote/conncontroller/conncontroller.go:1097–1110  ·  view source on GitHub ↗
(connName string)

Source from the content-addressed store, hash-verified

1095}
1096
1097func IsConnected(connName string) (bool, error) {
1098 if IsLocalConnName(connName) {
1099 return true, nil
1100 }
1101 connOpts, err := remote.ParseOpts(connName)
1102 if err != nil {
1103 return false, fmt.Errorf("error parsing connection name: %w", err)
1104 }
1105 conn := getConnInternal(connOpts, false)
1106 if conn == nil {
1107 return false, nil
1108 }
1109 return conn.GetStatus() == Status_Connected, nil
1110}
1111
1112// Convenience function for ensuring a connection is established
1113func EnsureConnection(ctx context.Context, connName string) error {

Callers 6

attemptAutoReconnectFunction · 0.92
CheckJobConnectedFunction · 0.92
StartJobFunction · 0.92
doReconnectJobFunction · 0.92
ReconnectJobsForConnFunction · 0.92
restartStreamingFunction · 0.92

Calls 4

ParseOptsFunction · 0.92
IsLocalConnNameFunction · 0.85
getConnInternalFunction · 0.70
GetStatusMethod · 0.45

Tested by

no test coverage detected