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

Method writeWithTimeout

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

Source from the content-addressed store, hash-verified

76}
77
78func (mc *mysqlConn) writeWithTimeout(b []byte) (int, error) {
79 to := mc.cfg.WriteTimeout
80 if to > 0 {
81 if err := mc.netConn.SetWriteDeadline(time.Now().Add(to)); err != nil {
82 return 0, err
83 }
84 }
85 return mc.netConn.Write(b)
86}
87
88func (mc *mysqlConn) resetSequence() {
89 mc.sequence = 0

Callers 1

writeCompressedPacketMethod · 0.80

Calls 2

SetWriteDeadlineMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected