mirror of https://github.com/jackc/pgx.git
conn.Close closes underlying conn
Previously, it merely sent the termination message.v3-experimental
parent
f597c16a7b
commit
84802ece05
5
conn.go
5
conn.go
|
@ -425,6 +425,11 @@ func (c *Conn) Close() (err error) {
|
|||
}
|
||||
|
||||
_, err = c.conn.Write([]byte{'X', 0, 0, 0, 4})
|
||||
if err != nil && c.shouldLog(LogLevelWarn) {
|
||||
c.log(LogLevelWarn, "Failed to send terminate message", "err", err)
|
||||
}
|
||||
|
||||
err = c.conn.Close()
|
||||
|
||||
c.die(errors.New("Closed"))
|
||||
if c.shouldLog(LogLevelInfo) {
|
||||
|
|
Loading…
Reference in New Issue