public static void InitSdk() { if (!SdkStatus.IsUnInit()) { return; } if (User != null) { UnInitSdk(); } // 正在初始化 SdkStatus.SetStatus(SdkStatus.StatusType.Initing); Core.InitModules(); BaseNetUtil.StopQueueLoop(); BaseNetUtil.StartQueueLoop(); // 设置 Socket 链接地址 Socket1.Url = Config.Url; // loginEvent += onSocketConnect; ListenSocketConnect(); Socket1.ConnectSocketTask("init Sdk"); }
public static void UnInitSdk() { if (SdkStatus.IsUnInit()) { return; } Pinger1.Stop(); Pinger2.Stop(); BaseNetUtil.StopQueueLoop(); Sdk.Instance.ClearResponse(); Core.UnInitModules(); SdkStatus.SetStatus(SdkStatus.StatusType.Uninit); UserStatus.SetStatus(UserStatus.StatusType.Logout); Sdk.Uninit(); }