private static void StartAccepting(object state) { ReliableChannelListener <TChannel, TReliableChannel, TInnerChannel> listener = (ReliableChannelListener <TChannel, TReliableChannel, TInnerChannel>)state; try { listener.StartAccepting(); } catch (Exception exception) { if (Fx.IsFatal(exception)) { throw; } listener.Fault(exception); } }
private static void OnAcceptCompletedStatic(IAsyncResult result) { if (!result.CompletedSynchronously) { ReliableChannelListener <TChannel, TReliableChannel, TInnerChannel> asyncState = (ReliableChannelListener <TChannel, TReliableChannel, TInnerChannel>)result.AsyncState; try { asyncState.OnAcceptCompleted(result); } catch (Exception exception) { if (Fx.IsFatal(exception)) { throw; } asyncState.Fault(exception); } } }