public void TestGenericNackEncode() { var pdu = new GenericNack(); pdu.sequence_number = 1; Assert.AreEqual(rawPdu, pdu.Encode(), "generic_nack should be properly encoded"); }
private void PduErrorEventHandler(object sender, PduErrorEventArgs e) { ResponsePdu resp = null; if (e.Pdu is RequestPdu) { RequestPdu req = (RequestPdu)e.Pdu; resp = req.CreateDefaultResponce(); resp.Header.ErrorCode = e.Exception.ErrorCode; } else { resp = new GenericNack(e.Header); resp.Header.ErrorCode = e.Exception.ErrorCode; } try { SendPduBase(resp); } catch { /*silent catch*/ } }