예제 #1
0
 private void RaiseSessionClosedEvent(SessionCloseReason reason, Exception ex)
 {
     if (SessionClosed == null)
     {
         return;
     }
     foreach (EventHandler <TcpIpSessionClosedEventArgs> del in SessionClosed.GetInvocationList())
     {
         SessionClosed.BeginInvoke(this, new TcpIpSessionClosedEventArgs(reason, ex),
                                   AsyncCallBackRaiseSessionClosedEvent, del);
     }
 }
예제 #2
0
        private void RaiseSessionClosedEvent(SmppSessionCloseReason reason, Exception exception)
        {
            if (SessionClosed == null)
            {
                return;
            }
            SmppSessionClosedEventArgs e = new SmppSessionClosedEventArgs(reason, exception);

            foreach (EventHandler <SmppSessionClosedEventArgs> del in SessionClosed.GetInvocationList())
            {
                del.BeginInvoke(this, e, AsyncCallBackRaiseSessionClosedEvent, del);
            }
        }
예제 #3
0
        private void RaiseSessionClosedEvent(SessionCloseReason reason, Exception ex)
        {
            if (SessionClosed == null)
            {
                return;
            }
            foreach (EventHandler <TcpIpSessionClosedEventArgs> del in SessionClosed.GetInvocationList())
            {
#if NET40
                SessionClosed.BeginInvoke(this, new TcpIpSessionClosedEventArgs(reason, ex),
                                          AsyncCallBackRaiseSessionClosedEvent, del);
#else
                System.Threading.Tasks.Task.Run(() => SessionClosed.Invoke(this, new TcpIpSessionClosedEventArgs(reason, ex)));
#endif
            }
        }
예제 #4
0
        private void RaiseSessionClosedEvent(SmppSessionCloseReason reason, Exception exception)
        {
            if (SessionClosed == null)
            {
                return;
            }
            SmppSessionClosedEventArgs e = new SmppSessionClosedEventArgs(reason, exception);

            foreach (EventHandler <SmppSessionClosedEventArgs> del in SessionClosed.GetInvocationList())
            {
#if NET40
                del.BeginInvoke(this, e, AsyncCallBackRaiseSessionClosedEvent, del);
#else
                System.Threading.Tasks.Task.Run(() => del.Invoke(this, e));
#endif
            }
        }