close on destruct; add reconnect support; change return value for publish()