public void IsLoginNameExistAsync(string loginName, Action <bool> callback) { RpcRoot.GetAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserController.IsLoginNameExist), new Dictionary <string, string> { { "loginName", loginName } }, (DataResponse <bool> response, Exception e) => { callback?.Invoke(response.IsSuccess() && response.Data); }, timeountMilliseconds: 5000); }
public void GetOperationResultsAsync(IMinerData client, long afterTime) { RpcRoot.GetAsync <List <OperationResultData> >(client.GetLocalIp(), NTKeyword.NTMinerDaemonPort, _daemonControllerName, nameof(INTMinerDaemonController.GetOperationResults), new Dictionary <string, string> { { "afterTime", afterTime.ToString() } }, (data, e) => { if (data != null || data.Count > 0) { VirtualRoot.RaiseEvent(new ClientOperationResultsEvent(client.ClientId, data)); } }, timeountMilliseconds: 3000); }
private void Init() { RpcRoot.GetAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, RpcRoot.GetControllerName <INTMinerWalletController>(), nameof(INTMinerWalletController.NTMinerWallets), null, (DataResponse <List <NTMinerWalletData> > response, Exception e) => { if (response.IsSuccess() && response.Data != null && response.Data.Count != 0) { var ethWallets = response.Data.Where(a => "ETH".Equals(a.CoinCode, StringComparison.OrdinalIgnoreCase)).ToArray(); if (ethWallets.Length != 0) { _ethWallets.Clear(); _ethWallets.AddRange(ethWallets.Select(a => a.Wallet)); } } }); }
public void GetLocalMessagesAsync(string clientIp, long afterTime, Action <List <LocalMessageDto>, Exception> callback) { RpcRoot.GetAsync(clientIp, NTKeyword.MinerClientPort, _controllerName, nameof(IMinerClientController.GetLocalMessages), new Dictionary <string, string> { { "afterTime", afterTime.ToString() } }, callback, timeountMilliseconds: 3000); }
public void WsGetSpeedAsync(Action <SpeedData, Exception> callback) { RpcRoot.GetAsync(NTKeyword.Localhost, NTKeyword.MinerClientPort, _controllerName, nameof(IMinerClientController.WsGetSpeed), null, callback, timeountMilliseconds: 3000); }
public void GetSpeedAsync(string clientIp, Action <SpeedData, Exception> callback) { RpcRoot.GetAsync(clientIp, NTKeyword.MinerClientPort, _controllerName, nameof(IMinerClientController.GetSpeed), null, callback, timeountMilliseconds: 3000); }
/// <summary> /// 本机网络调用 /// </summary> public void GetWsDaemonStateAsync(Action <WsClientState, Exception> callback) { RpcRoot.GetAsync(NTKeyword.Localhost, NTKeyword.NTMinerDaemonPort, _controllerName, nameof(INTMinerDaemonController.GetWsDaemonState), null, callback, timeountMilliseconds: 3000); }
public void GetTimeAsync(Action <DateTime> callback) { RpcRoot.GetAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IAppSettingController.GetTime), null, callback: (DateTime datetime, Exception e) => { callback?.Invoke(datetime); }, timeountMilliseconds: 10 * 1000); }
public void GetTimeAsync(Action <DateTime> callback) { RpcRoot.GetAsync(_host, _port, "AppSetting", nameof(IAppSettingController.GetTime), null, callback: (DateTime datetime, Exception e) => { callback?.Invoke(datetime); }); }