MCPcopy
hub / github.com/go-sql-driver/mysql / readWithTimeout

Method readWithTimeout

connection.go:68–76  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

66}
67
68func (mc *mysqlConn) readWithTimeout(b []byte) (int, error) {
69 to := mc.cfg.ReadTimeout
70 if to > 0 {
71 if err := mc.netConn.SetReadDeadline(time.Now().Add(to)); err != nil {
72 return 0, err
73 }
74 }
75 return mc.netConn.Read(b)
76}
77
78func (mc *mysqlConn) writeWithTimeout(b []byte) (int, error) {
79 to := mc.cfg.WriteTimeout

Callers

nothing calls this directly

Calls 2

SetReadDeadlineMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected