From 1801c54ae8996f7710907a4f2d0aa05c6c0c9640 Mon Sep 17 00:00:00 2001 From: Ned Palacios Date: Thu, 21 Mar 2024 14:32:59 +0800 Subject: [PATCH] fix(server): trigger try reconnect on windows --- server/daemon/client/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/daemon/client/client.go b/server/daemon/client/client.go index 641b37b..309b08b 100644 --- a/server/daemon/client/client.go +++ b/server/daemon/client/client.go @@ -126,7 +126,8 @@ func (c *Client) Connect() error { conn, err := net.Dial("tcp", c.addr) if err != nil { if err, ok := err.(*net.OpError); ok { - if strings.HasSuffix(err.Err.Error(), "connection refused") { + msg := err.Err.Error() + if strings.HasSuffix(msg, "connection refused") || strings.HasSuffix(msg, "No connection could be made because the target machine actively refused it.") { return c.tryReconnect(err) } }