void DisconnectUser() { try { client.CheckConnectClientToHost(); thread = new Thread(Nothing); client.Disconnect(ID); ReconnectingPrepare(); } catch { if (!CheckConnectIsBegin) { thread = new Thread(CheckConnect); thread.Start(); } } }
void CheckConnect() { if (!CheckConnectIsBegin) { CheckConnectIsBegin = true; Thread.Sleep(20000); client = new ServiceGameClient(new InstanceContext(this)); try { client.CheckConnectClientToHost(); } catch { client.Close(); this.Close(); } } }