func (c *ConnWithTimeout) Read(b []byte) (int, error) {
	err := c.Conn.SetReadDeadline(time.Now().Add(c.readTimeout))
	if err != nil {
		return 0, err
	}
	return c.Conn.Read(b)
}
Read reads data from the connection and calls net.SetReadDeadline before reading.
package transport
import (
	"net"
	"time"
	"github.com/buraksezer/connpool"
)
type ConnWithTimeout struct {
	net.Conn
	readTimeout  time.Duration
	writeTimeout time.Duration
}
func NewConnWithTimeout(conn net.Conn, readTimeout, writeTimeout time.Duration) *ConnWithTimeout {
	return &ConnWithTimeout{
		Conn:         conn,
		readTimeout:  readTimeout,
		writeTimeout: writeTimeout,
	}
}