}
// Kill forcefully terminates the connection. It's safe to call Kill (and
-// Wait) multiple times.
+// Wait) multiple times. Calling it before Dial*() was called will only close
+// the Events channel.
func (c *Conn) Kill() error {
if c.cmd == nil {
+ if c.events != nil {
+ close(c.events)
+ c.events = nil
+ }
return fmt.Errorf("Dial*() not called or already terminated")
}