Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
Merge branch 'hotfix-7.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonsmits committed Mar 23, 2017
2 parents 64e863d + c591c75 commit 0174029
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/NServiceBus.Hosting.Windows/WindowsHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ namespace NServiceBus.Hosting.Windows
{
using System;
using System.Collections.Generic;
using Logging;

/// <summary>
/// A windows implementation of the NServiceBus hosting solution
/// </summary>
public class WindowsHost : MarshalByRefObject
{
ILog Log = LogManager.GetLogger<WindowsHost>();
GenericHost genericHost;

/// <summary>
Expand All @@ -26,16 +28,31 @@ public WindowsHost(Type endpointType, string[] args, string endpointName, IEnume
/// </summary>
public void Start()
{
genericHost.Start().GetAwaiter().GetResult();
try
{
genericHost.Start().GetAwaiter().GetResult();
}
catch (Exception ex)
{
Log.Fatal("Start failure", ex);
Environment.Exit(-1);
}
}

/// <summary>
/// Does shutdown work.
/// </summary>
public void Stop()
{
genericHost.Stop().GetAwaiter().GetResult();
try
{
genericHost.Stop().GetAwaiter().GetResult();
}
catch (Exception ex)
{
Log.Fatal("Stop failure", ex);
Environment.Exit(-2);
}
}

}
}

0 comments on commit 0174029

Please sign in to comment.