ping server periodically to check connection status