try to reconnect if message delivery fails

Addresses #4
Why two versions?