读书人

联通sgip1.2 socket提交信息体由主机字

发布时间: 2012-03-16 16:34:56 作者: rapoo

联通sgip1.2 socket提交信息体由主机字节转为网络字节产生地址越界

C# code
        public uint MessageLength        {            get            {                return (uint)IPAddress.NetworkToHostOrder((int)_messageLength);            }            set            {                _messageLength = (uint)IPAddress.HostToNetworkOrder((int)value);            }        }


C# code
public byte[] GetBytes()        {            byte[] result = new byte[this.GetLength()];                     Buffer.BlockCopy(_head.GetBytes(), 0, result, 0, _head.GetLength());            Buffer.BlockCopy(_body.GetBytes(), 0, result, _head.GetLength(), _body.GetLength());            return result;        }


[解决办法]
111

读书人网 >移动平台

热点推荐