github.com/jbronn/packer@v0.1.6-0.20140120165540-8a1364dbd817/communicator/ssh/connect.go (about) 1 package ssh 2 3 import ( 4 "net" 5 "time" 6 ) 7 8 // ConnectFunc is a convenience method for returning a function 9 // that just uses net.Dial to communicate with the remote end that 10 // is suitable for use with the SSH communicator configuration. 11 func ConnectFunc(network, addr string) func() (net.Conn, error) { 12 return func() (net.Conn, error) { 13 return net.DialTimeout(network, addr, 15*time.Second) 14 } 15 }