Source File
conn.go
Belonging Package
github.com/gliderlabs/ssh
package sshimport ()type serverConn struct {net.ConnidleTimeout time.DurationmaxDeadline time.TimecloseCanceler context.CancelFunc}func ( *serverConn) ( []byte) ( int, error) {.updateDeadline(), = .Conn.Write()if , := .(net.Error); && .closeCanceler != nil {.closeCanceler()}return}func ( *serverConn) ( []byte) ( int, error) {.updateDeadline(), = .Conn.Read()if , := .(net.Error); && .closeCanceler != nil {.closeCanceler()}return}func ( *serverConn) () ( error) {= .Conn.Close()if .closeCanceler != nil {.closeCanceler()}return}func ( *serverConn) () {switch {case .idleTimeout > 0::= time.Now().Add(.idleTimeout)if .Unix() < .maxDeadline.Unix() || .maxDeadline.IsZero() {.Conn.SetDeadline()return}fallthroughdefault:.Conn.SetDeadline(.maxDeadline)}}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |