// Token: 0x06000170 RID: 368 RVA: 0x0000D284 File Offset: 0x0000B484
 public void run()
 {
     try
     {
         while (Session_ME2.connected)
         {
             Message message = this.readMessage();
             if (message == null)
             {
                 break;
             }
             try
             {
                 if ((int)message.command == -27)
                 {
                     this.getKey(message);
                 }
                 else
                 {
                     Session_ME2.onRecieveMsg(message);
                 }
             }
             catch (Exception)
             {
                 Cout.println("LOI NHAN  MESS THU 1");
             }
             try
             {
                 Thread.Sleep(5);
             }
             catch (Exception)
             {
                 Cout.println("LOI NHAN  MESS THU 2");
             }
         }
     }
     catch (Exception ex)
     {
         Debug.Log("error read message!");
         Debug.Log(ex.Message.ToString());
     }
     if (Session_ME2.connected)
     {
         if (Session_ME2.messageHandler != null)
         {
             if (Session_ME2.currentTimeMillis() - Session_ME2.timeConnected > 500)
             {
                 Session_ME2.messageHandler.onDisconnected(Session_ME2.isMainSession);
             }
             else
             {
                 Session_ME2.messageHandler.onConnectionFail(Session_ME2.isMainSession);
             }
         }
         if (Session_ME2.sc != null)
         {
             Session_ME2.cleanNetwork();
         }
     }
 }
 // Token: 0x06000160 RID: 352 RVA: 0x0000CDA8 File Offset: 0x0000AFA8
 public void doConnect(string host, int port)
 {
     Session_ME2.sc = new TcpClient();
     Session_ME2.sc.Connect(host, port);
     Session_ME2.dataStream = Session_ME2.sc.GetStream();
     Session_ME2.dis        = new BinaryReader(Session_ME2.dataStream, new UTF8Encoding());
     Session_ME2.dos        = new BinaryWriter(Session_ME2.dataStream, new UTF8Encoding());
     new Thread(new ThreadStart(Session_ME2.sender.run)).Start();
     Session_ME2.MessageCollector @object = new Session_ME2.MessageCollector();
     Cout.LogError("new -----");
     Session_ME2.collectorThread = new Thread(new ThreadStart(@object.run));
     Session_ME2.collectorThread.Start();
     Session_ME2.timeConnected = Session_ME2.currentTimeMillis();
     Session_ME2.connecting    = false;
     Session_ME2.doSendMessage(new Message(-27));
 }