static private GetNetworkListenerName ( XDTransportMode transportMode ) : string | ||
transportMode | XDTransportMode | |
return | string |
private void RegisterNetworkListener(XDTransportMode mode) { if (disposed) { return; } if (!IsAlive) { return; } Task.Factory.StartNew(() => { propagateListener.RegisterChannel( NetworkRelayBroadcaster.GetNetworkListenerName(mode)); propagateListener.MessageReceived += OnNetworkMessageReceived; }).ContinueWith(t => { // ReSharper disable once UnusedVariable var e = t.Exception; if (disposed) { return; } Thread.Sleep(NetworkReTryTimeoutMilliSeconds); RegisterNetworkListener(mode); }, TaskContinuationOptions.OnlyOnFaulted); }
private void RegisterNetworkListener(XDTransportMode mode) { if (disposed) { return; } if (!IsAlive) { return; } // listen on the network channel for this mode Task.Factory.StartNew(() => { propagateListener.RegisterChannel( NetworkRelayBroadcaster.GetNetworkListenerName(mode)); propagateListener.MessageReceived += OnNetworkMessageReceived; }).ContinueWith(t => { var e = t.Exception; if (!disposed) { Thread.Sleep(networkReTryTimeoutMilliSeconds); // retry attach listener RegisterNetworkListener(mode); } }, TaskContinuationOptions.OnlyOnFaulted); }