gracefully reconnect to server

Too frequent connecting/closing socket kills nats server

Change-Id: I29b59e40c4efd30b2abfde77fa7d6dc3318abe82