(b []byte)
| 836 | } |
| 837 | |
| 838 | func (c *tcpRWTimeoutConn) Read(b []byte) (int, error) { |
| 839 | if c.readTimeout > 0 { |
| 840 | err := c.TCPConn.SetReadDeadline(time.Now().Add(c.readTimeout)) |
| 841 | if err != nil { |
| 842 | if ce := c.logger.Check(zapcore.ErrorLevel, "failed to set read deadline"); ce != nil { |
| 843 | ce.Write(zap.Error(err)) |
| 844 | } |
| 845 | } |
| 846 | } |
| 847 | return c.TCPConn.Read(b) |
| 848 | } |
| 849 | |
| 850 | func (c *tcpRWTimeoutConn) Write(b []byte) (int, error) { |
| 851 | if c.writeTimeout > 0 { |