added exception handling and reconnection logic

https://jira.oceanobservatories.org/tasks/browse/OOIION-1324