diff options
Diffstat (limited to 'internal/net/conn.go')
| -rw-r--r-- | internal/net/conn.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/net/conn.go b/internal/net/conn.go index ca40354..a4be83a 100644 --- a/internal/net/conn.go +++ b/internal/net/conn.go @@ -23,6 +23,10 @@ type Conn interface { // instead of a hung writer goroutine. Implementations without deadline // support return nil (deadlines are best-effort). SetWriteDeadline(t time.Time) error + // SetReadDeadline is the read-side counterpart: transports implement it so + // a silent peer cannot pin a goroutine and a connection slot forever. + // Implementations without deadline support return nil. + SetReadDeadline(t time.Time) error SetEcho(bool) error } @@ -114,6 +118,10 @@ func (t *tcpConn) SetWriteDeadline(ts time.Time) error { return t.conn.SetWriteDeadline(ts) } +func (t *tcpConn) SetReadDeadline(ts time.Time) error { + return t.conn.SetReadDeadline(ts) +} + func (t *tcpConn) Close() error { return t.conn.Close() } |
