added logic to reconnect after a network timeout to web socket API.