Exemplo n.º 1
0
        protected override async Task ExecuteAsync(CancellationToken cancellationToken)
        {
            IServiceScope    serviceScope    = serviceProvider.CreateScope();
            IListenerService listenerService = serviceScope.ServiceProvider.GetService <IListenerService>();

            await listenerService.Execute(cancellationToken);
        }
 public HomeController(GeoplacementClickerDbContext dbContext,
                       IListenerService listenerService,
                       IConfiguration configuration)
 {
     _dbContext       = dbContext;
     _listenerService = listenerService;
 }
Exemplo n.º 3
0
        public IListenerService GetListenerService()
        {
            if (fListenerService == null)
            {
                string r = ConfigurationManager.AppSettings["ListenerService"];
                if (string.IsNullOrEmpty(r))
                {
                    fListenerService = new HttpListenerService();
                }
                else
                {
                    switch (r)
                    {
                    case "HttpListenerService":
                    {
                        fListenerService = new HttpListenerService();
                        break;
                    }

                    case "MemoryListenerService":
                    {
                        fListenerService = new MemoryListenerService();
                        break;
                    }

                    default:
                    {
                        fListenerService = new HttpListenerService();
                        break;
                    }
                    }
                }
            }
            return(fListenerService);
        }
Exemplo n.º 4
0
        private IListenerService _listenerService;                  // A listener that receives messages.

        public DataHandler(IListenerService listenerService, IClientService clientService)
        {
            _clientService   = clientService;
            _listenerService = listenerService;

            _listenerService.StartListener(ReceivedInformation);
        } // End of Constructor
Exemplo n.º 5
0
        public Service1(IListenerService listenerService, ICommandService commandService)
        {
            _listenerService = listenerService;
            _commandService = commandService;

            InitializeComponent();
        }
Exemplo n.º 6
0
 public AuthController(SignInManager <User> signInManager, UserManager <User> userManager, IOptions <GeneralConfig> generalConfig, IAccountService accountService, IOperationService operationService, IListenerService listener)
 {
     _signInManager    = signInManager;
     _userManager      = userManager;
     _generalConfig    = generalConfig.Value;
     _accountService   = accountService;
     _operationService = operationService;
     _listener         = listener;
 }
        public ValuesController(IHostedService listenerService,
                                TestDataContext testDataContext)
        {
            this.listenerService = listenerService as IListenerService;

            if (this.listenerService is null)
            {
                throw new ArgumentException("IHostedService type must be of IListenerService");
            }
        }
Exemplo n.º 8
0
        private IListenerService _listenerService;                      // A listener that receives messages.

        public DataHandler(IListenerService listenerService, IClientService clientService)
        {
            _clientService   = clientService;
            _listenerService = listenerService;

            _listenerService.StartListener(UpdateOutputTextBoxesDuringEvents);

            _timer.Interval = TimeSpan.FromMilliseconds(5000); // Set the period of the events.
            _timer.Tick    += sendData;                        // Attach handler

            _timer.Start();
        } // End of Constructor
Exemplo n.º 9
0
 private void DoListen(Object aMsg)
 {
     try
     {
         if (fListener == null)
         {
             fListener = ActorServer.GetInstance().ListenerService;
         }
         IContextComm context = fListener.GetCommunicationContext();
         RemoteReceiverActor.Cast(context);
         SendMessage("Listen");
     }
     catch (Exception e)
     {
         Debug.WriteLine("Can't listen " + e);
         Become(new NullBehavior());
     }
 }
Exemplo n.º 10
0
        private bool disposedValue = false; // Pour détecter les appels redondants

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // TODO: supprimer l'état managé (objets managés).
                    if (fListenerService != null)
                    {
                        ((IDisposable)fListenerService).Dispose();
                        fListenerService = null;
                    }
                }

                // TODO: libérer les ressources non managées (objets non managés) et remplacer un finaliseur ci-dessous.
                // TODO: définir les champs de grande taille avec la valeur Null.

                disposedValue = true;
            }
        }
Exemplo n.º 11
0
 public AppCache(IListenerService listenerService)
 {
     _listenerService = listenerService;
 }
Exemplo n.º 12
0
 public HostRelayActor(IListenerService listenerService)
 {
     fListener = listenerService;
     Become(new Behavior <String>(t => "Listen".Equals(t), DoListen));
 }
Exemplo n.º 13
0
 public ClientManager(IListenerService listenerService, IPublisher publisher, IClientsContainer clientsContainer)
 {
     _listenerService  = listenerService;
     _publisher        = publisher;
     _clientsContainer = clientsContainer;
 }
Exemplo n.º 14
0
 public ChartController(IHubContext <ChartHub> hub, IListenerService listenerService)
 {
     _hub             = hub;
     _listenerService = listenerService;
 }