go-irc / irc

A simple go irc library meant to be a building block for other projects
MIT License
142 stars 17 forks source link

Fix read loop not exiting when the server closes the connection #73

Closed belak closed 4 years ago

belak commented 5 years ago

This is technically a backwards incompatible change as it updates the Client to require a ReadWriteCloser rather than just a ReadWriter. This makes it possible to force the readLoop to exit.

This builds on PR #72 by @SeanLatimer

belak commented 5 years ago

There is another option where we use a net.Conn - this may actually be useful because then we can use SetDeadline properly.

belak commented 4 years ago

I think this is fine for now because it's the least intrusive. I don't know what a better interface would look like, but if we can improve on this in the future I'd like to.