Added reconnect logic
Merge branch 'swift' of https://github.com/sascha/dooropener into swift