MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / switchToNodeLocked

Method switchToNodeLocked

internal/home/client.go:421–433  ·  view source on GitHub ↗
(node clusterNode)

Source from the content-addressed store, hash-verified

419}
420
421func (c *Client) switchToNodeLocked(node clusterNode) bool {
422 host := strings.TrimSpace(node.IP)
423 if host == "" || node.Port <= 0 {
424 return false
425 }
426 if strings.TrimSpace(c.homeCfg.Host) == host && c.homeCfg.Port == node.Port {
427 return false
428 }
429 c.homeCfg.Host = host
430 c.homeCfg.Port = node.Port
431 c.closeClientsLocked()
432 return true
433}
434
435func (c *Client) markReconnectFailure(reason string) {
436 switched, addr := c.failoverAfterReconnectFailure()

Callers 2

refreshClusterNodesMethod · 0.95

Calls 1

closeClientsLockedMethod · 0.95

Tested by

no test coverage detected