Пример #1
0
 public static Message GetBlock(this Message message, BlockInfo blockInfo)
 {
     return message.GetBlock(blockInfo.Num, blockInfo.Szx);
 }
Пример #2
0
 public static Message GetBlock(this Message message, BlockInfo blockInfo)
 {
     return(message.GetBlock(blockInfo.Num, blockInfo.Szx));
 }
Пример #3
0
        private BlockInfo NegotiateBlockSize(Message message)
        {
            var blockInfo = new BlockInfo { Szx = _szx };
            var response = message as Response;

            if (response != null) {
                var block2 = response.Request.GetBlockOption(OptionNumber.Block2);

                if (block2 != null) {
                    blockInfo.Num = block2.Num;

                    if (block2.Szx < _szx) {
                        blockInfo.Szx = block2.Szx;
                    }
                }
            }

            return blockInfo;
        }