public Task StartAsync()
 {
     _log.Debug("Starting");
     _settingsWriter.Write("address", _pipeName);
     _settingsWriter.SignalInitialized();
     return(TaskConstants.Completed);
 }
Пример #2
0
 protected override Task <Task> StartCoreAsync()
 {
     _log.Debug("Starting");
     _settingsWriter.Write("address", _pipeName);
     _settingsWriter.SignalInitialized();
     _log.Info("Pipe server started: {0}", _pipeName);
     return(Task.FromResult(ProcessAsync()));
 }
Пример #3
0
        public void OnListeningStarted()
        {
            var feature = _host.ServerFeatures.Get <IServerAddressesFeature>();
            var url     = feature.Addresses.First();

            _stateWriter.Write("address", url.Replace("http://", "ws://"));
            Log.Info("Websocket server started: {0}", url);
            _stateWriter.SignalInitialized();
            SetStartCompleted();
        }
Пример #4
0
 public void OnListeningStarted()
 {
     try
     {
         var feature = _host.ServerFeatures.Get <IServerAddressesFeature>();
         var url     = feature.Addresses.First();
         _stateWriter.Write("address", url.Replace("http://", "ws://"));
         Log.Info("Listening started on url {0}", url);
         _stateWriter.SignalInitialized();
         _startCompletion.TryComplete();
     }
     catch (Exception ex)
     {
         _startCompletion.TryFail(ex);
     }
 }
Пример #5
0
 protected override async Task <Task> StartCoreAsync()
 {
     FleckLog.Level     = LogLevel.Debug;
     FleckLog.LogAction = (lvl, msg, exc) =>
     {
         Log.Debug(exc, msg);
     };
     using (_stateWriter)
         using (_server = CreateWebSocketServerWithRetry(_options.Port))
         {
             var address = "ws://" + _server.ListenerSocket.LocalEndPoint;
             _stateWriter.Write("address", address);
             _stateWriter.SignalInitialized();
             SetStartCompleted();
             Log.Info("WebSocket server started on {0}", address);
             await CancellationToken.ToAwaitable().AsTask().IgnoreAnyCancellation().ConfigureAwait(false);
         }
     return(TaskConstants.Completed);
 }