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.
1 files changed, 2 insertions(+), 1 deletions(-) M conn.go
M conn.go => conn.go +2 -1
@@ 84,9 84,10 @@ func (c *conn) Close() error { return fmt.Errorf("connection already closed") } + err := c.net.Close() c.closed = true close(c.outgoing) - return nil + return err } func (c *conn) ReadMessage() (*irc.Message, error) {