Reconnect to a third party server

first i want to connect to my server using tcp socket, here is my project frame:

class CNetworkAgent : public FTickableGameObject;
in its Tick() virtual function, i want to recv and send message to my server, and process connect when the netwok is not valid. but i found FSocket::Connect() function tick too much time, therefor, i want to put the connect() function to another thread, throw TGraphTask model, on windows platform editor, it works prefect well, but on android device, the app will exit when i take the wifi off, here is the core code in my project, please help me!!

bool CNetworkAgent::Tick()
{
ShowStatus();// show some network status, such as network is valid, recv bytes, etc..
if (IsNetworkOk())
	{
            Recv();
		ProcessProtocol();
		Send();
		return true;
	}
	else
	{
		AddConnectTask();
	}
	return false;
}

bool CNetworkAgent::AddConnectTask()
{
	std::unique_lock<std::mutex> ilock(g_lock); // add locks
	if (!m_lpEvent || m_lpEvent->IsComplete())
	{
		m_lpSocket->Close();
		ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->DestroySocket(m_lpSocket);
		m_lpSocket = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateSocket(NAME_Stream, TEXT("GS_SOCKET"), false);
		m_bConnected = false;
		m_lpEvent = TGraphTask<CTaskFactory>::CreateTask().ConstructAndDispatchWhenReady();
		++m_nErrorTimes;
		return true;
	}
	return false;
}

bool CNetworkAgent::IsNetworkOk()
{
	return m_lpEvent && m_lpEvent->IsComplete() && m_bConnected; // when network is not valid and the Task is complete, return true;
}

// this function is work in another thread, so add lock
void CTaskFactory::DoTask(ENamedThreads::Type CurrentThread, const FGraphEventRef& MyCompletionGraphEvent)
{
	std::unique_lock<std::mutex> ilock(g_lock);
	FSocket* lpSocket = CNetworkAgent::GetInstance().GetSocket();
	if (!lpSocket)
	{
		return;
	}
	CNetworkAgent::GetInstance().SetConnected(lpSocket->Connect(*CNetworkAgent::GetInstance().GetAddr()));
	UE_LOG(SchoolNetwork, Warning, TEXT("CTaskFactory::DoTask"));
}