Пример #1
0
        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);
            }
        }
Пример #2
0
        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())
            {
#if NET40
                del.BeginInvoke(this, e, AsyncCallBackRaisePduErrorEvent, del);
#else
                System.Threading.Tasks.Task.Run(() => del.Invoke(this, e));
#endif
            }
        }
Пример #3
0
        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*/ }
        }
Пример #4
0
 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); }
 }