Example #1
0
 // Token: 0x0600002B RID: 43 RVA: 0x00002974 File Offset: 0x00000B74
 public void Connect(string h, int p)
 {
     try
     {
         try
         {
             bool flag = this.C != null;
             if (flag)
             {
                 this.C.Close();
                 this.C = null;
             }
         }
         catch (Exception ex)
         {
         }
         while (this.IsBuzy)
         {
             Thread.Sleep(1);
         }
         try
         {
             this.C = new TcpClient();
             this.C.Connect(h, p);
             Thread thread = new Thread(new ThreadStart(this.RC), 10);
             thread.Start();
             SocketClient.ConnectedEventHandler connectedEvent = this.ConnectedEvent;
             bool flag = connectedEvent != null;
             if (flag)
             {
                 connectedEvent();
             }
         }
         catch (Exception ex2)
         {
         }
     }
     catch (Exception ex3)
     {
         SocketClient.DisconnectedEventHandler disconnectedEvent = this.DisconnectedEvent;
         bool flag = disconnectedEvent != null;
         if (flag)
         {
             disconnectedEvent();
         }
     }
 }
Example #2
0
        // Token: 0x0600002C RID: 44 RVA: 0x00002AA8 File Offset: 0x00000CA8
        public void DisConnect()
        {
            try
            {
                this.C.Close();
            }
            catch (Exception ex)
            {
            }
            this.C = null;
            SocketClient.DisconnectedEventHandler disconnectedEvent = this.DisconnectedEvent;
            bool flag = disconnectedEvent != null;

            if (flag)
            {
                disconnectedEvent();
            }
        }