Added Connected method

This commit is contained in:
Tyler Sommer 2014-10-23 18:17:58 -07:00
parent 18b9dfbf29
commit 533177a490

5
irc.go
View File

@ -294,6 +294,11 @@ func (irc *Connection) ErrorChan() chan error {
return irc.Error return irc.Error
} }
// Returns true if the connection is connected to an IRC server.
func (irc *Connection) Connected() bool {
return !irc.stopped
}
// A disconnect sends all buffered messages (if possible), // A disconnect sends all buffered messages (if possible),
// stops all goroutines and then closes the socket. // stops all goroutines and then closes the socket.
func (irc *Connection) Disconnect() { func (irc *Connection) Disconnect() {