Server connectivity for calendar and some abstraction for server.
This commit is contained in:
@@ -115,7 +115,7 @@ namespace Wino.Core.UWP.Services
|
||||
|
||||
var connectionCancellationToken = new CancellationTokenSource(TimeSpan.FromMilliseconds(ServerConnectionTimeoutMs));
|
||||
|
||||
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
|
||||
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("WinoServer");
|
||||
|
||||
// Connection establishment handler is in App.xaml.cs OnBackgroundActivated.
|
||||
// Once the connection is established, the handler will set the Connection property
|
||||
|
||||
@@ -234,7 +234,26 @@ namespace Wino.Core.UWP
|
||||
Analytics.TrackEvent("Wino Crashed", parameters);
|
||||
}
|
||||
|
||||
public virtual void OnResuming(object sender, object e) { }
|
||||
|
||||
public virtual async void OnResuming(object sender, object e)
|
||||
{
|
||||
// App Service connection was lost on suspension.
|
||||
// We must restore it.
|
||||
// Server might be running already, but re-launching it will trigger a new connection attempt.
|
||||
|
||||
try
|
||||
{
|
||||
await AppServiceConnectionManager.ConnectAsync();
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "Failed to connect to server after resuming the app.");
|
||||
}
|
||||
}
|
||||
public virtual void OnSuspending(object sender, SuspendingEventArgs e) { }
|
||||
|
||||
public abstract IServiceProvider ConfigureServices();
|
||||
|
||||
Reference in New Issue
Block a user