示例#1
0
        public RpcWebClient(IRpcSettings rpcSettings, ITimerSettings timerSettings)
        {
            RpcSettings   = rpcSettings;
            TimerSettings = timerSettings;

            var httpClientHandler = new HttpClientHandler();

            if (httpClientHandler.SupportsAutomaticDecompression)
            {
                httpClientHandler.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
            }

            if (httpClientHandler.SupportsProxy)
            {
                var proxy = rpcSettings.Proxy;
                if (proxy != null)
                {
                    httpClientHandler.Proxy    = proxy;
                    httpClientHandler.UseProxy = true;
                }
            }

            HttpClient = new HttpClient(httpClientHandler)
            {
                Timeout = TimeSpan.FromMilliseconds(Timeout.Infinite)
            };

            HttpClient.DefaultRequestHeaders.ExpectContinue = false;
        }
        /// <summary>Creates a new instance of Monero API .NET's RPC manager service.</summary>
        /// <param name="rpcSettings">IP-related settings to use when communicating through the Monero core assemblies' RPC protocol.</param>
        /// <param name="timerSettings">Timer settings which can be used to alter data fetching intervals.</param>
        public MoneroRpcManager(IRpcSettings rpcSettings, ITimerSettings timerSettings)
        {
            if (rpcSettings == null)
            {
                rpcSettings = new RpcSettings();
            }
            if (timerSettings == null)
            {
                timerSettings = new TimerSettings();
            }

            RpcWebClient = new RpcWebClient(rpcSettings, timerSettings);

            RpcSettings   = rpcSettings;
            TimerSettings = timerSettings;

            Daemon         = new DaemonRpcManager(RpcWebClient);
            AccountManager = new AccountRpcManager(RpcWebClient);
        }
示例#3
0
 public IndicatorUpdateTimer(ILog log, IIndicatorUpdateCoordinator indicatorUpdateCoordinator, ITimerSettings settings)
 {
     _log = log;
     _indicatorUpdateCoordinator = indicatorUpdateCoordinator;
     _settings = settings;
 }