private void SocketListener_stopStreaming(object sender, string args) { StationLib.StationSocketListener SocketListener = sender as StationLib.StationSocketListener; if (args.Length > 0) { if (SocketListener != null) { ThreadPoolTimer timer = ThreadPoolTimer.CreateTimer((t) => { SocketListener.stopProcessingPackagesAsync();// Restart Processing Packages SocketListener.startProcessingPackagesAsync(); //do some work \ dispatch to UI thread as needed }, TimeSpan.FromSeconds(20)); } if (SocketListener.FailedConnectionCount <= 1) { ShowMessage(args); notificationEmail(SocketListener, args); } } ReleaseDisplay(SocketListener); }
async void startRecording_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e) { StationLib.StationSocketListener plistener = m_SocketStationListeners.getSelectedItem(); if (plistener != null) { await plistener.startProcessingPackagesAsync(); } }
private void SocketListener_Failed(object sender, string args) { // Failed after Trying Connection StationLib.StationSocketListener SocketListener = sender as StationLib.StationSocketListener; if (SocketListener.FailedConnectionCount <= 1) { ShowMessage(args); notificationEmail(SocketListener, args); } if (SocketListener != null) { ThreadPoolTimer timer = ThreadPoolTimer.CreateTimer((t) => { SocketListener.stopProcessingPackagesAsync();// Restart Processing Packages SocketListener.startProcessingPackagesAsync(); //do some work \ dispatch to UI thread as needed }, TimeSpan.FromSeconds(5)); } }