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); } }
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); } }
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 } }
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 } }