Minor refactoring so that can reuse connection down.
Starting a separate thread for periodically sending heartbeats to opposite side.