From 04463f8254a9fe6f31a936e50a8a8109080c92ec Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 14 Jul 2013 20:31:51 +0900 Subject: [PATCH] communicator/ssh: ConnectFunc times out after 15 sceonds --- communicator/ssh/connect.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/communicator/ssh/connect.go b/communicator/ssh/connect.go index cfd55b348..edca0db17 100644 --- a/communicator/ssh/connect.go +++ b/communicator/ssh/connect.go @@ -3,6 +3,7 @@ package ssh import ( "log" "net" + "time" ) // ConnectFunc is a convenience method for returning a function @@ -11,6 +12,6 @@ import ( func ConnectFunc(network, addr string) func() (net.Conn, error) { return func() (net.Conn, error) { log.Printf("Opening conn for SSH to %s %s", network, addr) - return net.Dial(network, addr) + return net.DialTimeout(network, addr, 15 * time.Second) } }