This commit is contained in:
2026-06-10 20:27:44 +02:00
parent 42b5c6247d
commit 6150498a9e
9 changed files with 223 additions and 120 deletions
+1 -1
View File
@@ -317,7 +317,7 @@ func (s *session) run() {
// Returns the moment we marked the link "connected" (zero if dial failed)
// and the error that ended the session (nil if stopCh).
func (s *session) runOnce() (time.Time, error) {
addr := fmt.Sprintf("%s:%d", s.cfg.Host, s.cfg.Port)
addr := net.JoinHostPort(s.cfg.Host, fmt.Sprintf("%d", s.cfg.Port)) // IPv6-safe
conn, err := net.DialTimeout("tcp", addr, 10*time.Second)
if err != nil {
return time.Time{}, fmt.Errorf("dial %s: %w", addr, err)