Register connect and disconnect on namespace object
Catch exception for websocket transport