This also lays the foundation for the possibility of log drivers in the future, if it is decided that is a direction to pursue. Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
19 lines
259 B
Go
19 lines
259 B
Go
package ssh
|
|
|
|
import "net"
|
|
|
|
func WaitForTCP(addr string) error {
|
|
for {
|
|
conn, err := net.Dial("tcp", addr)
|
|
if err != nil {
|
|
continue
|
|
}
|
|
defer conn.Close()
|
|
if _, err = conn.Read(make([]byte, 1)); err != nil {
|
|
continue
|
|
}
|
|
break
|
|
}
|
|
return nil
|
|
}
|