test case and proposed fix for issue #182, sub sockets not reconnecting

test case and proposed fix for issue #182, sub sockets not reconnecting
refreshed and tested against latest master