public void SendMsgBlk(bool isTimerExpire, bool isSameSegment, DWHashAlgValues dwHashAlgoValues, uint index, bool isLastBLK)
{
PccrrBLKResponsePacket pccrrBLKResponsePacket;
if (!isSameSegment && dwHashAlgoValues == DWHashAlgValues.V1)
{
this.sid = Encoding.UTF8.GetBytes(this.GetProperty("PCCRR.Protocol.ErrorSegmentId"));
pccrrBLKResponsePacket = this.pccrrStackSer.CreateMsgBlkResponse(this.sid, new byte[] { }, this.cryptoAlgo, MsgType_Values.MSG_BLK, this.protoVer, isLastBLK);
}
else
{
if (dwHashAlgoValues == DWHashAlgValues.V3)
{
this.sid = PccrrUtitlity.ToByteArray(this.GetProperty("PCCRR.Protocol.SHA512.SegmentId"));
}
else
{
this.sid = PccrrUtitlity.ToByteArray(this.GetProperty("PCCRR.Protocol.SHA384.SegmentId"));
}
pccrrBLKResponsePacket = this.pccrrStackSer.CreateMsgBlkResponse(this.sid, new byte[] { }, this.cryptoAlgo, MsgType_Values.MSG_BLK, this.protoVer, isLastBLK);
}
MSG_BLK msgBLK = new MSG_BLK();
msgBLK = pccrrBLKResponsePacket.MsgBLK;
msgBLK.BlockIndex = index;
if (!isLastBLK)
{
if (index == uint.MaxValue)
{
throw new ArgumentOutOfRangeException("index");
}
else
{
msgBLK.NextBlockIndex = index + 1;
}
}
pccrrBLKResponsePacket.MsgBLK = msgBLK;
try
{
this.pccrrStackSer.SendPacket(pccrrBLKResponsePacket);
}
catch (HttpListenerException ex)
{
if (ex.ErrorCode == 1229 && isTimerExpire)
{
this.ReceivingTimeOut();
}
}
}