Пример #1
0
        /// <summary>
        ///     发送并接收数据,不进行协议扩展和收缩,用于特殊协议
        /// </summary>
        /// <param name="content">发送协议的内容</param>
        /// <returns>接收协议的内容</returns>
        public override async Task <byte[]> SendReceiveWithoutExtAndDecAsync(byte[] content)
        {
            var receiveBytes = await BaseConnector.SendMsgAsync(content);

            //seems to be protocol-specific but calls virtual method so it might be overridden
            var checkRight = CheckRight(receiveBytes);

            return(checkRight == null ? new byte[0] : (!checkRight.Value ? null : receiveBytes));
            //返回字符
        }
Пример #2
0
        /// <summary>
        ///     发送并接收数据,不进行协议扩展和收缩,用于特殊协议
        /// </summary>
        /// <param name="content">发送协议的内容</param>
        /// <returns>接收协议的内容</returns>
        public override async Task <byte[]> SendReceiveWithoutExtAndDecAsync(byte[] content)
        {
            //发送数据
            var receiveBytes = await BaseConnector.SendMsgAsync(content);

            //容错处理
            var checkRight = CheckRight(receiveBytes);

            return(checkRight == null ? new byte[0] : (!checkRight.Value ? null : receiveBytes));
            //返回字符
        }