Exemplo n.º 1
0
 public bool ClientOpen(string pcsServerIP, int nServerPort)
 {
     m_szServerAddr     = pcsServerIP;
     m_nServerPort      = nServerPort;
     m_nPrepareReadSize = 0;
     m_nReadPos         = 0;
     m_tcp.ConnectToServer(m_szServerAddr, m_nServerPort);
     return(IsConnect());
 }
Exemplo n.º 2
0
 void  ThreadRun()
 {
     if (m_tcp != null)
     {
         m_tcp.Close();
     }
     else
     {
         m_tcp = new CTcp();
     }
     m_tcp.ConnectToServer(m_szConnectAddr, m_nConnectPort, m_nRandSeed);
     if (m_tcp.IsConnect())
     {
         OnSucConnect();
     }
     else
     {
         OnFailedConect();
     }
     // 开始接收消息吧
     BeginRecive();
 }