Example #1
0
        public void Release()
        {
            if (null != m_tcpClient)
            {
                m_tcpClient.Release();
                m_tcpClient = null;
            }

            ResetSession();
        }
Example #2
0
        public void Init()
        {
            m_sessions     = new Dictionary <uint, TcpPacket>();
            m_pushHandlers = new Dictionary <uint, NetPushHandler>();

            m_tcpClient = new TcpClientWorker();
            string ip   = "127.0.0.1"; //端口和ip应该有公共方法进行读取
            int    port = 5555;

            LoggerHelper.Log(string.Format("ip: {0}, port: {1}", ip, port));
            m_tcpClient.Connect(ip, port);
        }