internal void AddClient(string address, iExchange.Common.AppType appType) { lock (_mutex) { if (_disconnectedClientManager.Contains(address) && appType == iExchange.Common.AppType.TransactionServer) { return; } _disconnectedClientManager.Remove(address); if (_clientDict.ContainsKey(address)) { return; } try { var client = CreateClient(address, appType); if (client == null) { return; } Logger.InfoFormat("add client url = {0}", address); this.AddClient(client); } catch (Exception ex) { Logger.Error(ex); } } }
internal void Add(string url, iExchange.Common.AppType appType) { lock (_mutex) { if (!_clients.ContainsKey(url)) { _clients.Add(url, new ClientInfo(appType)); } } }
private static ClientBase CreateClient(string address, iExchange.Common.AppType appType) { try { var channel = CreateChannel(address); return(ClientFactory.Create(channel, address, appType)); } catch (Exception ex) { Logger.Error(ex); return(null); } }
private static ClientBase CreateClientAndTest(string address, iExchange.Common.AppType appType) { try { var channel = CreateChannel(address); channel.Test(); return(ClientFactory.Create(channel, address, appType)); } catch (Exception ex) { Logger.ErrorFormat("CreateClientAndTest address = {0}, appType = {1}, error= {2}", address, appType, ex); return(null); } }
internal ClientInfo(iExchange.Common.AppType appType) { this.AppType = appType; this.TryConnectedCount = 0; }
internal void AddClient(string address, iExchange.Common.AppType appType) { _clientManager.AddClient(address, appType); }
internal static ClientBase Create(ICommandCollectService service, string url, iExchange.Common.AppType appType) { if (appType == iExchange.Common.AppType.TransactionServer) { return(new TransactionClient(service, url, appType)); } return(new Client(service, url, appType)); }
internal TransactionClient(ICommandCollectService service, string serviceUrl, iExchange.Common.AppType appType) : base(service, serviceUrl, appType) { _commandManager = new CommandManager(this); }
internal Client(ICommandCollectService service, string serviceUrl, iExchange.Common.AppType appType) : base(service, serviceUrl, appType) { _actionBlock = new ActionBlock <Command>((Action <Command>) this.SendCommandHandle); }
protected ClientBase(ICommandCollectService service, string serviceUrl, iExchange.Common.AppType appType) { _service = service; _serviceUrl = serviceUrl; _appType = appType; }
public void Register(string address, iExchange.Common.AppType appType) { this.Call(() => this.Service.Register(address, appType)); }
public void Register(string address, iExchange.Common.AppType appType) { base.Channel.Register(address, appType); }