try making sure the connection closes in the SAM availability checker too

This commit is contained in:
idk
2020-08-14 17:15:06 -04:00
parent 64390e2d8e
commit dd4d554fc2
2 changed files with 12 additions and 1 deletions

View File

@ -300,5 +300,16 @@ func SAM() error {
} else {
tcp4.Write([]byte("sam.create\n"))
}
return nil
for i := 1; i < 10; i++ {
conn, err := net.Dial("tcp4", net.JoinHostPort(loopbackInterface(), "7656"))
if err != nil {
log.Println("Connecting error:", err)
}
if conn != nil {
conn.Close()
return nil
}
time.Sleep(time.Duration(i*10) * time.Second)
}
return fmt.Errorf("Error connecting to %s", "SAM port")
}

BIN
zero

Binary file not shown.