Close net.Conn in conn.Close
Close the connection in conn.Close. This ensures the connection isn't still alive after conn.Close, which would cause issues when disconnecting and reconnecting quickly to an upstream server.
This commit is contained in:
parent
cb99e97f5f
commit
bee2001e29
3
conn.go
3
conn.go
@ -84,9 +84,10 @@ func (c *conn) Close() error {
|
|||||||
return fmt.Errorf("connection already closed")
|
return fmt.Errorf("connection already closed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err := c.net.Close()
|
||||||
c.closed = true
|
c.closed = true
|
||||||
close(c.outgoing)
|
close(c.outgoing)
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *conn) ReadMessage() (*irc.Message, error) {
|
func (c *conn) ReadMessage() (*irc.Message, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user