public override void Start() { lock (base.SyncRoot) { IConsumerService service = base.Scope.GetService(typeof(IConsumerService)) as IConsumerService; try { this._videoCodecFactory = new VideoCodecFactory(); this._checkVideoCodec = true; } catch (Exception exception) { log.Warn("No video codec factory available.", exception); } this._firstPacketTime = this._audioTime = this._videoTime = this._dataTime = -1; this._connMsgOut = service.GetConsumerOutput(this); this._connMsgOut.Subscribe(this, null); this._recordPipe = new InMemoryPushPushPipe(); Dictionary <string, object> parameterMap = new Dictionary <string, object>(); parameterMap.Add("record", null); this._recordPipe.Subscribe(this, parameterMap); this._recording = false; this._recordingFilename = null; base.CodecInfo = new StreamCodecInfo(); this._closed = false; this._bytesReceived = 0L; this._creationTime = Environment.TickCount; } }
public override void Start() { lock (this.SyncRoot) { IConsumerService consumerManager = this.Scope.GetService(typeof(IConsumerService)) as IConsumerService; try { //_videoCodecFactory = new VideoCodecFactory(); _videoCodecFactory = this.Scope.GetService(typeof(VideoCodecFactory)) as VideoCodecFactory; _checkVideoCodec = true; } catch (Exception ex) { log.Warn("No video codec factory available.", ex); } _firstPacketTime = _audioTime = _videoTime = _dataTime = -1; _connMsgOut = consumerManager.GetConsumerOutput(this); _connMsgOut.Subscribe(this, null); _recordPipe = new InMemoryPushPushPipe(); #if !(NET_1_1) Dictionary <string, object> recordParameterMap = new Dictionary <string, object>(); #else Hashtable recordParameterMap = new Hashtable(); #endif // Clear record flag recordParameterMap.Add("record", null); _recordPipe.Subscribe(this as IProvider, recordParameterMap); _recording = false; _recordingFilename = null; this.CodecInfo = new StreamCodecInfo(); _closed = false; _bytesReceived = 0; _creationTime = System.Environment.TickCount; } }
public NoteService(INoteDAL noteDAL, IConsumerService consumerService, IBarberService barberService, IHaircutService haircutService) { this.NoteDAL = noteDAL; this.ConsumerService = consumerService; this.BarberService = barberService; this.HaircutService = haircutService; }
public void Register() { lock (base.SyncRoot) { if (!this._isRegistered) { IStreamFilenameGenerator generator = ObjectFactory.CreateInstance(this._appConfig.StreamFilenameGenerator.Type) as IStreamFilenameGenerator; base.AddService(typeof(IStreamFilenameGenerator), generator, false); generator.Start(this._appConfig.StreamFilenameGenerator); ISharedObjectService service = ObjectFactory.CreateInstance(this._appConfig.SharedObjectServiceConfiguration.Type) as ISharedObjectService; base.AddService(typeof(ISharedObjectService), service, false); service.Start(this._appConfig.SharedObjectServiceConfiguration); IProviderService service2 = ObjectFactory.CreateInstance(this._appConfig.ProviderServiceConfiguration.Type) as IProviderService; base.AddService(typeof(IProviderService), service2, false); service2.Start(this._appConfig.ProviderServiceConfiguration); IConsumerService service3 = ObjectFactory.CreateInstance(this._appConfig.ConsumerServiceConfiguration.Type) as IConsumerService; base.AddService(typeof(IConsumerService), service3, false); service3.Start(this._appConfig.ConsumerServiceConfiguration); IStreamService service4 = ObjectFactory.CreateInstance(this._appConfig.StreamService.Type) as IStreamService; base.AddService(typeof(IStreamService), service4, false); service4.Start(this._appConfig.StreamService); if (this._appConfig.SharedObjectSecurityService.Type != null) { ISharedObjectSecurityService service5 = ObjectFactory.CreateInstance(this._appConfig.SharedObjectSecurityService.Type) as ISharedObjectSecurityService; base.AddService(typeof(ISharedObjectSecurityService), service5, false); service5.Start(this._appConfig.SharedObjectSecurityService); } base.Init(); base._keepOnDisconnect = true; this._isRegistered = true; } } }
public NoteController(INoteService noteService, IConsumerService consumerService, IBarberService barberService, IHaircutService haircutService) { NoteService = noteService; ConsumerService = consumerService; BarberService = barberService; HaircutService = haircutService; }
public NdmSubprotocolFactory( IMessageSerializationService?messageSerializationService, INodeStatsManager?nodeStatsManager, ILogManager?logManager, IAccountService?accountService, IConsumerService?consumerService, INdmConsumerChannelManager?ndmConsumerChannelManager, IEcdsa?ecdsa, IWallet?wallet, INdmFaucet?faucet, PublicKey?nodeId, Address?providerAddress, Address?consumerAddress, bool verifySignature = true) { if (nodeStatsManager == null) { throw new ArgumentNullException(nameof(nodeStatsManager)); } MessageSerializationService = messageSerializationService ?? throw new ArgumentNullException(nameof(messageSerializationService)); NodeStatsManager = nodeStatsManager ?? throw new ArgumentNullException(nameof(nodeStatsManager)); LogManager = logManager ?? throw new ArgumentNullException(nameof(logManager)); AccountService = accountService ?? throw new ArgumentNullException(nameof(accountService)); ConsumerService = consumerService ?? throw new ArgumentNullException(nameof(consumerService)); NdmConsumerChannelManager = ndmConsumerChannelManager ?? throw new ArgumentNullException(nameof(ndmConsumerChannelManager)); Ecdsa = ecdsa ?? throw new ArgumentNullException(nameof(ecdsa)); Wallet = wallet ?? throw new ArgumentNullException(nameof(wallet)); Faucet = faucet ?? throw new ArgumentNullException(nameof(faucet)); NodeId = nodeId ?? throw new ArgumentNullException(nameof(nodeId)); ProviderAddress = providerAddress; ConsumerAddress = consumerAddress; VerifySignature = verifySignature; AccountService.AddressChanged += (_, e) => ConsumerAddress = e.NewAddress; }
public AvroMessageController(IProducerService _producerService, IConsumerService _consumerService, IConfiguration _configuration, ILogger <AvroMessageController> _logger) { producerService = _producerService; consumerService = _consumerService; configuration = _configuration; logger = _logger; }
public NdmRpcConsumerModule( IConsumerService consumerService, IDepositReportService depositReportService, IJsonRpcNdmConsumerChannel jsonRpcNdmConsumerChannel, IEthRequestService ethRequestService, IEthPriceService ethPriceService, IDaiPriceService daiPriceService, IGasPriceService gasPriceService, IConsumerTransactionsService transactionsService, IConsumerGasLimitsService gasLimitsService, IWallet personalBridge, ITimestamper timestamper) { _consumerService = consumerService ?? throw new ArgumentNullException(nameof(consumerService)); _depositReportService = depositReportService ?? throw new ArgumentNullException(nameof(depositReportService)); _jsonRpcNdmConsumerChannel = jsonRpcNdmConsumerChannel ?? throw new ArgumentNullException(nameof(jsonRpcNdmConsumerChannel)); _ethRequestService = ethRequestService ?? throw new ArgumentNullException(nameof(ethRequestService)); _ethPriceService = ethPriceService ?? throw new ArgumentNullException(nameof(ethPriceService)); _daiPriceService = daiPriceService ?? throw new ArgumentNullException(nameof(daiPriceService)); _gasPriceService = gasPriceService ?? throw new ArgumentNullException(nameof(gasPriceService)); _transactionsService = transactionsService ?? throw new ArgumentNullException(nameof(transactionsService)); _gasLimitsService = gasLimitsService ?? throw new ArgumentNullException(nameof(gasLimitsService)); _wallet = personalBridge ?? throw new ArgumentNullException(nameof(personalBridge)); _timestamper = timestamper ?? throw new ArgumentNullException(nameof(timestamper)); }
public BrokerDaemon(ILogger <BrokerDaemon> loggerFactory, IOptionsSnapshot <BrokerConfig> config, IConsumerService consumerService) { _logger = loggerFactory; _brokerConfig = config.Value; _consumerSvc = consumerService; }
public StoryPullerService(ILogger <StoryPullerService> logger, IConfiguration configuration, IHackerNewsService service, IConsumerService consumerService) { _logger = logger; _service = service; _consumerService = consumerService; _retrievalIntervalInSeconds = configuration.GetValue <int>("RetrievalIntervalInSeconds"); }
public NdmRpcConsumerModule(IConsumerService consumerService, IReportService reportService, IJsonRpcNdmConsumerChannel jsonRpcNdmConsumerChannel, IEthRequestService ethRequestService, IPersonalBridge personalBridge, ILogManager logManager) : base(logManager) { _consumerService = consumerService; _reportService = reportService; _jsonRpcNdmConsumerChannel = jsonRpcNdmConsumerChannel; _ethRequestService = ethRequestService; _personalBridge = personalBridge; }
public MainController ( IProducerService producerService, IConsumerService consumerService, MessageHub messageHub ) { _producerService = producerService; _consumerService = consumerService; _messageHub = messageHub; }
public HomeController( IConsumerService consumerService, INumberServiceTransient transientNumberService, INumberServiceScoped scopedNumberService, INumberServiceSingleton singletonNumberService) { this.consumerService = consumerService; this.transientNumberService = transientNumberService; this.scopedNumberService = scopedNumberService; this.singletonNumberService = singletonNumberService; }
public void Setup() { _consumerService = Substitute.For <IConsumerService>(); _depositReportService = Substitute.For <IDepositReportService>(); _jsonRpcNdmConsumerChannel = Substitute.For <IJsonRpcNdmConsumerChannel>(); _ethRequestService = Substitute.For <IEthRequestService>(); _personalBridge = Substitute.For <IPersonalBridge>(); _timestamper = new Timestamper(Date); _rpc = new NdmRpcConsumerModule(_consumerService, _depositReportService, _jsonRpcNdmConsumerChannel, _ethRequestService, _personalBridge, _timestamper); }
public NdmProviderSubprotocolFactory(IMessageSerializationService messageSerializationService, INodeStatsManager nodeStatsManager, ILogManager logManager, IAccountService accountService, IConsumerService consumerService, IProviderService providerService, INdmConsumerChannelManager ndmConsumerChannelManager, IEcdsa ecdsa, IWallet wallet, INdmFaucet faucet, PublicKey nodeId, Address providerAddress, Address consumerAddress, bool verifySignature = true) : base( messageSerializationService, nodeStatsManager, logManager, accountService, consumerService, ndmConsumerChannelManager, ecdsa, wallet, faucet, nodeId, providerAddress, consumerAddress, verifySignature) { _providerService = providerService; _providerService.AddressChanged += (_, e) => ProviderAddress = e.NewAddress; }
public NdmRpcConsumerModule(IConsumerService consumerService, IDepositReportService depositReportService, IJsonRpcNdmConsumerChannel jsonRpcNdmConsumerChannel, IEthRequestService ethRequestService, IPersonalBridge personalBridge, ITimestamper timestamper) { _consumerService = consumerService; _depositReportService = depositReportService; _jsonRpcNdmConsumerChannel = jsonRpcNdmConsumerChannel; _ethRequestService = ethRequestService; _personalBridge = personalBridge; _timestamper = timestamper; }
public NdmCapabilityConnector(IProtocolsManager protocolsManager, INdmSubprotocolFactory subprotocolFactory, IConsumerService consumerService, IProtocolValidator protocolValidator, IEthRequestService ethRequestService, ILogManager logManager, Address providerAddress = null) { _protocolsManager = protocolsManager; _subprotocolFactory = subprotocolFactory; _consumerService = consumerService; _protocolValidator = protocolValidator; _ethRequestService = ethRequestService; _logManager = logManager; _providerAddress = providerAddress; }
private void BuildSubprotocol() { ISession session = Substitute.For <ISession>(); INodeStatsManager nodeStatsManager = new NodeStatsManager(Substitute.For <ITimerFactory>(), LimboLogs.Instance); MessageSerializationService serializationService = new MessageSerializationService(); serializationService.Register(typeof(HiMessage).Assembly); IConsumerService consumerService = Substitute.For <IConsumerService>(); INdmConsumerChannelManager consumerChannelManager = Substitute.For <INdmConsumerChannelManager>(); EthereumEcdsa ecdsa = new EthereumEcdsa(ChainId.Mainnet, LimboLogs.Instance); _subprotocol = new NdmSubprotocol(session, nodeStatsManager, serializationService, LimboLogs.Instance, consumerService, consumerChannelManager, ecdsa, new DevWallet(new WalletConfig(), LimboLogs.Instance), Substitute.For <INdmFaucet>(), TestItem.PublicKeyB, TestItem.AddressB, TestItem.AddressA, false); }
public void Setup() { _consumerService = Substitute.For <IConsumerService>(); _depositReportService = Substitute.For <IDepositReportService>(); _jsonRpcNdmConsumerChannel = Substitute.For <IJsonRpcNdmConsumerChannel>(); _ethRequestService = Substitute.For <IEthRequestService>(); _ethPriceService = Substitute.For <IEthPriceService>(); _gasPriceService = Substitute.For <IGasPriceService>(); _gasLimitsService = Substitute.For <IConsumerGasLimitsService>(); _consumerTransactionsService = Substitute.For <IConsumerTransactionsService>(); _wallet = Substitute.For <IWallet>(); _timestamper = new Timestamper(Date); _rpc = new NdmRpcConsumerModule(_consumerService, _depositReportService, _jsonRpcNdmConsumerChannel, _ethRequestService, _ethPriceService, _gasPriceService, _consumerTransactionsService, _gasLimitsService, _wallet, _timestamper); }
public void Setup() { _session = Substitute.For <ISession>(); _nodeStatsManager = Substitute.For <INodeStatsManager>(); _messageSerializationService = Substitute.For <IMessageSerializationService>(); _ecdsa = Substitute.For <IEcdsa>(); _wallet = Substitute.For <IWallet>(); _faucet = Substitute.For <INdmFaucet>(); _configuredNodeId = TestItem.PublicKeyA; _consumerService = Substitute.For <IConsumerService>(); _ndmConsumerChannelManager = Substitute.For <INdmConsumerChannelManager>(); _configuredProviderAddress = TestItem.AddressA; _configuredConsumerAddress = TestItem.AddressB; _verifySignature = false; InitSubprotocol(); }
public NdmRpcConsumerModule(IConsumerService consumerService, IDepositReportService depositReportService, IJsonRpcNdmConsumerChannel jsonRpcNdmConsumerChannel, IEthRequestService ethRequestService, IEthPriceService ethPriceService, IGasPriceService gasPriceService, IConsumerTransactionsService transactionsService, IConsumerGasLimitsService gasLimitsService, IPersonalBridge personalBridge, ITimestamper timestamper) { _consumerService = consumerService; _depositReportService = depositReportService; _jsonRpcNdmConsumerChannel = jsonRpcNdmConsumerChannel; _ethRequestService = ethRequestService; _ethPriceService = ethPriceService; _gasPriceService = gasPriceService; _transactionsService = transactionsService; _gasLimitsService = gasLimitsService; _personalBridge = personalBridge; _timestamper = timestamper; }
public void Setup() { _messageSerializationService = Substitute.For <IMessageSerializationService>(); _nodeStatsManager = Substitute.For <INodeStatsManager>(); _logManager = Substitute.For <ILogManager>(); _accountService = Substitute.For <IAccountService>(); _consumerService = Substitute.For <IConsumerService>(); _ndmConsumerChannelManager = Substitute.For <INdmConsumerChannelManager>(); _ecdsa = Substitute.For <IEcdsa>(); _wallet = Substitute.For <IWallet>(); _faucet = Substitute.For <INdmFaucet>(); _nodeId = TestItem.PublicKeyA; _providerAddress = TestItem.AddressA; _consumerAddress = TestItem.AddressB; _verifySignature = false; _factory = new NdmSubprotocolFactory(_messageSerializationService, _nodeStatsManager, _logManager, _accountService, _consumerService, _ndmConsumerChannelManager, _ecdsa, _wallet, _faucet, _nodeId, _providerAddress, _consumerAddress, _verifySignature); }
public NdmSubprotocolFactory(IMessageSerializationService messageSerializationService, INodeStatsManager nodeStatsManager, ILogManager logManager, IConsumerService consumerService, INdmConsumerChannelManager ndmConsumerChannelManager, IEcdsa ecdsa, IWallet wallet, INdmFaucet faucet, PublicKey nodeId, Address providerAddress, Address consumerAddress, bool verifySignature = true) { MessageSerializationService = messageSerializationService; NodeStatsManager = nodeStatsManager ?? throw new ArgumentNullException(nameof(nodeStatsManager)); LogManager = logManager; ConsumerService = consumerService; NdmConsumerChannelManager = ndmConsumerChannelManager; Ecdsa = ecdsa; Wallet = wallet; Faucet = faucet; NodeId = nodeId; ProviderAddress = providerAddress; ConsumerAddress = consumerAddress; VerifySignature = verifySignature; ConsumerService.AddressChanged += (_, e) => ConsumerAddress = e.NewAddress; }
public override void Start() { // Ensure the play engine exists if (_engine == null) { IScope scope = this.Scope; if (scope != null) { ISchedulingService schedulingService = scope.GetService(typeof(ISchedulingService)) as ISchedulingService; IConsumerService consumerService = scope.GetService(typeof(IConsumerService)) as IConsumerService; IProviderService providerService = scope.GetService(typeof(IProviderService)) as IProviderService; _engine = new PlayEngine.Builder(this, schedulingService, consumerService, providerService).Build(); } else { if (log.IsErrorEnabled) { log.Error("Scope was null on start"); } } } // Create bw control service and register myself // Bandwidth control service should not be bound to a specific scope because it's designed to control // the bandwidth system-wide. _bwController = this.Scope.GetService(typeof(IBWControlService)) as IBWControlService; _bwContext = _bwController.RegisterBWControllable(this); //Set bandwidth members on the engine _engine.SetBandwidthController(_bwController, _bwContext); //Set buffer check interval _engine.BufferCheckInterval = _bufferCheckInterval; //Set underrun trigger _engine.UnderrunTrigger = _underrunTrigger; // Start playback engine _engine.Start(); // Notify subscribers on start NotifySubscriberStart(); }
public NdmProviderSubprotocol(ISession p2PSession, INodeStatsManager nodeStatsManager, IMessageSerializationService serializer, ILogManager logManager, IConsumerService consumerService, IProviderService providerService, INdmConsumerChannelManager ndmConsumerChannelManager, IEcdsa ecdsa, IWallet wallet, INdmFaucet faucet, PublicKey nodeId, Address configuredProviderAddress, Address configuredConsumerAddress, bool verifySignature = true) : base(p2PSession, nodeStatsManager, serializer, logManager, consumerService, ndmConsumerChannelManager, ecdsa, wallet, faucet, nodeId, configuredProviderAddress, configuredConsumerAddress, verifySignature) { _providerService = providerService; MessageHandlers[NdmMessageCode.GetDataAssets] = message => Handle(Deserialize <GetDataAssetsMessage>(message.Data)); MessageHandlers[NdmMessageCode.GetDepositApprovals] = message => Handle(Deserialize <GetDepositApprovalsMessage>(message.Data)); MessageHandlers[NdmMessageCode.RequestDepositApproval] = message => Handle(Deserialize <RequestDepositApprovalMessage>(message.Data)); MessageHandlers[NdmMessageCode.DataDeliveryReceipt] = message => Handle(Deserialize <DataDeliveryReceiptMessage>(message.Data)); MessageHandlers[NdmMessageCode.DisableDataStream] = message => Handle(Deserialize <DisableDataStreamMessage>(message.Data)); MessageHandlers[NdmMessageCode.EnableDataStream] = message => Handle(Deserialize <EnableDataStreamMessage>(message.Data)); MessageHandlers[NdmMessageCode.FinishSession] = message => Handle(Deserialize <FinishSessionMessage>(message.Data)); MessageHandlers[NdmMessageCode.DataRequest] = message => Handle(Deserialize <DataRequestMessage>(message.Data)); MessageHandlers[NdmMessageCode.ConsumerAddressChanged] = message => Handle(Deserialize <ConsumerAddressChangedMessage>(message.Data)); MessageHandlers[NdmMessageCode.RequestEth] = message => Handle(Deserialize <RequestEthMessage>(message.Data)); }
/// <summary> /// Creates a play engine based on current services (scheduling service, consumer service, and provider service). /// </summary> /// <param name="schedulingService">The scheduling service.</param> /// <param name="consumerService">The consumer service.</param> /// <param name="providerService">The provider service.</param> /// <returns>Play engine.</returns> PlayEngine CreateEngine(ISchedulingService schedulingService, IConsumerService consumerService, IProviderService providerService) { _engine = new PlayEngine.Builder(this, schedulingService, consumerService, providerService).Build(); return(_engine); }
public Builder(PlaylistSubscriberStream playlistSubscriberStream, ISchedulingService schedulingService, IConsumerService consumerService, IProviderService providerService) { _playlistSubscriberStream = playlistSubscriberStream; _schedulingService = schedulingService; _consumerService = consumerService; _providerService = providerService; }
/// <summary> /// Creates a play engine based on current services (scheduling service, consumer service, and provider service). /// </summary> /// <param name="schedulingService">The scheduling service.</param> /// <param name="consumerService">The consumer service.</param> /// <param name="providerService">The provider service.</param> /// <returns>Play engine.</returns> PlayEngine CreateEngine(ISchedulingService schedulingService, IConsumerService consumerService, IProviderService providerService) { _engine = new PlayEngine.Builder(this, schedulingService, consumerService, providerService).Build(); return _engine; }
private PlayEngine(Builder builder) { _playlistSubscriberStream = builder.PlaylistSubscriberStream; _schedulingService = builder.SchedulingService; _consumerService = builder.ConsumerService; _providerService = builder.ProviderService; //_playlistSubscriberStream = stream; //_schedulingService = _playlistSubscriberStream.Scope.GetService(typeof(ISchedulingService)) as ISchedulingService; }
public NdmConsumerServices(IAccountService accountService, IConsumerService consumerService) { AccountService = accountService; ConsumerService = consumerService; }
public Consumer(IConsumerService consumerSvc) { this.consumerSvc = consumerSvc; }
public ConsumerHostedService(IConsumerService scopedProcessingService) { _consumerService = scopedProcessingService; }
public TestController(IConsumerService consumerService) { this._consumerService = consumerService; }