Exemple #1
0
        public static PSocketMsg Parse(byte[] data, TcpP2pType type)
        {
            var msg = new PSocketMsg();

            if (data != null)
            {
                msg.BodyLength = data.Length;
            }
            else
            {
                msg.BodyLength = 0;
            }

            msg.Type = (byte)type;

            if (msg.BodyLength > 0)
            {
                msg.Content = data;
            }

            return(msg);
        }