static void Main(string[] args) { _endpoint = new SendAndProcessEndpoint <BaseEndpointConfig>(new ServerConfig()); AsyncMain().GetAwaiter().GetResult(); //AsyncMain1().GetAwaiter().GetResult(); AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit); }
protected async Task OnStartAsync() { try { var builder = EndpointConfig.GetContainerBuilder(); _endpoint = new SendAndProcessEndpoint <BaseEndpointConfig>(EndpointConfig); var container = await _endpoint.Create(builder).ConfigureAwait(false); await _endpoint.StartEndpoint().ConfigureAwait(false); //starts wcf host _serviceHostsActivator = container.Resolve <ServiceHostsActivator>(); _serviceStartAndShutDownActivator = container.Resolve <StartupAndShutdownActivator>(); await PerformStartupOperations().ConfigureAwait(false); } catch (Exception ex) { //TODO: Log Exception Environment.FailFast("Failed to start " + _endpointName + " Endpoint." + ex.GetBaseException() + ex); } }
static void Main() { _endpoint = new SendAndProcessEndpoint <BaseEndpointConfig>(new Subscriber1Config()); AsyncMain().GetAwaiter().GetResult(); AppDomain.CurrentDomain.ProcessExit += OnProcessExit; }
static void Main(string[] args) { _endpoint = new SendAndProcessEndpoint <BaseEndpointConfig>(new ClientConfig()); AsyncMain().GetAwaiter().GetResult(); }