Exemple #1
0
 private void OnClosed(object sender, EventArgs e)
 {
     IsConnected = false;
     if (!IsReconnecting)
     {
         WSMgr.OnConnectStateChanged(BindAi, false);
     }
 }
Exemple #2
0
        public void Connect()
        {
            if (client.State == WebSocketState.Open)
            {
                IsConnected = true;
                WSMgr.OnConnectStateChanged(BindAi, true);
                return;
            }

            client.Open();

            Thread.Sleep(1000);
            if (client.State != WebSocketState.Open)
            {
                return;
            }

            IsConnected = true;
            WSMgr.OnConnectStateChanged(BindAi, true);
        }