コード例 #1
0
        private Message CreateMessage(byte[] encoded)
        {
            byte type = encoded[0];

            if (MessageTypes.IsP2p(type))
            {
                return(this.p2p_message.Create(encoded));
            }

            if (MessageTypes.IsMineral(type))
            {
                return(this.mineral_message.Create(encoded));
            }

            throw new P2pException(P2pException.ErrorType.NO_SUCH_MESSAGE, "type=" + encoded[0]);
        }