Пример #1
0
        /// <summary>
        /// 心跳消息
        /// </summary>
        private void doHeartBt()
        {
            try
            {
                if (!this.mNetClient.IsConnected())
                {
                    return;
                }

                var heartBtMsg = MsgFactory.getHeartBtMessage();
                var sendData   = heartBtMsg.ToBytes();
                this.sendData(sendData);
            }
            catch (Exception ex)
            {
                YunLib.LogWriter.Log(ex.ToString());
            }
        }
Пример #2
0
        /// <summary>
        /// 登录
        /// </summary>
        private void doLogin()
        {
            try
            {
                if (!this.mNetClient.IsConnected())
                {
                    return;
                }

                YunLib.LogWriter.Log("DataClient.doLogin Begin.");
                Console.WriteLine("DataClient.doLogin Begin.");

                var loginMsg = MsgFactory.getLogonMessage();
                var sendData = loginMsg.ToBytes();
                this.sendData(sendData);

                YunLib.LogWriter.Log("DataClient.doLogin End.");
                Console.WriteLine("DataClient.doLogin End.");
            }
            catch (Exception ex)
            {
                YunLib.LogWriter.Log(ex.ToString());
            }
        }