Skip to content

Commit 2cea98c

Browse files
committed
docs: add documentation about timeout
1 parent 80dfa95 commit 2cea98c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

connection.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const (
2020
DefaultSSHPort = 10022
2121
)
2222

23+
// writeTimeoutConn is a net.Conn that sets the write timeout on every call to Write().
2324
type writeTimeoutConn struct {
2425
net.Conn
2526
timeout time.Duration
@@ -41,6 +42,7 @@ type legacyConnection struct {
4142
}
4243

4344
// Connect connects to the address with the given timeout.
45+
// The timeout is used as dial and write timeout.
4446
func (c *legacyConnection) Connect(addr string, timeout time.Duration) error {
4547
addr, err := verifyAddr(addr, DefaultPort)
4648
if err != nil {
@@ -68,6 +70,7 @@ type sshConnection struct {
6870
}
6971

7072
// 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.
7174
func (c *sshConnection) Connect(addr string, timeout time.Duration) error {
7275
addr, err := verifyAddr(addr, DefaultSSHPort)
7376
if err != nil {

0 commit comments

Comments
 (0)