[client] connecting to server and responding to heartbeats