SetDeadline sets both read and write deadlines, as per net.Conn interface docs: "It is equivalent to calling both SetReadDeadline and SetWriteDeadline." Note there is no synchronization here, but the gorilla implementation isn't thread safe anyway
(t time.Time)
| 69 | // "It is equivalent to calling both SetReadDeadline and SetWriteDeadline." |
| 70 | // Note there is no synchronization here, but the gorilla implementation isn't thread safe anyway |
| 71 | func (c *GorillaConn) SetDeadline(t time.Time) error { |
| 72 | if err := c.Conn.SetReadDeadline(t); err != nil { |
| 73 | return fmt.Errorf("error setting read deadline: %w", err) |
| 74 | } |
| 75 | if err := c.Conn.SetWriteDeadline(t); err != nil { |
| 76 | return fmt.Errorf("error setting write deadline: %w", err) |
| 77 | } |
| 78 | return nil |
| 79 | } |
| 80 | |
| 81 | type Conn struct { |
| 82 | rw io.ReadWriter |
no test coverage detected