private void RaisePduErrorEvent(PduException exception, byte[] byteDump, PduHeader header, Pdu pdu) { if (PduError == null) { return; } PduErrorEventArgs e = new PduErrorEventArgs(exception, byteDump, header, pdu); foreach (EventHandler <PduErrorEventArgs> del in PduError.GetInvocationList()) { del.BeginInvoke(this, e, AsyncCallBackRaisePduErrorEvent, del); } }
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*/ } }