File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ const (
20
20
DefaultSSHPort = 10022
21
21
)
22
22
23
+ // writeTimeoutConn is a net.Conn that sets the write timeout on every call to Write().
23
24
type writeTimeoutConn struct {
24
25
net.Conn
25
26
timeout time.Duration
@@ -41,6 +42,7 @@ type legacyConnection struct {
41
42
}
42
43
43
44
// Connect connects to the address with the given timeout.
45
+ // The timeout is used as dial and write timeout.
44
46
func (c * legacyConnection ) Connect (addr string , timeout time.Duration ) error {
45
47
addr , err := verifyAddr (addr , DefaultPort )
46
48
if err != nil {
@@ -68,6 +70,7 @@ type sshConnection struct {
68
70
}
69
71
70
72
// Connect connects to the address with the given timeout and opens a new SSH channel with attached shell.
73
+ // The timeout is used as dial and write timeout.
71
74
func (c * sshConnection ) Connect (addr string , timeout time.Duration ) error {
72
75
addr , err := verifyAddr (addr , DefaultSSHPort )
73
76
if err != nil {
You can’t perform that action at this time.
0 commit comments