/// <summary> /// Class constructor /// </summary> public BondWorkerClient( LoggingContext loggingContext, string workerName, string ipAddress, int port, DistributionServices services, EventHandler onActivateConnection, EventHandler onDeactivateConnection, EventHandler onConnectionTimeOut) { m_loggingContext = loggingContext; m_workerName = workerName; m_proxyManager = new BondProxyConnectionManager <WorkerProxyAdapter>( client: new BondTcpClient <WorkerProxyAdapter>( new BondHostLog(loggingContext, ipAddress, port), new BondConnectOptions(true, (uint)EngineEnvironmentSettings.DistributionConnectTimeout.Value.TotalMilliseconds)), loggingContext: loggingContext, services: services, createProxyCallback: client => new WorkerProxyAdapter( ResiliencyTestBondTransportClient.TryWrapClientForTest(DistributedBuildRoles.Master, client))); m_proxyManager.OnActivateConnection += onActivateConnection; m_proxyManager.OnDeactivateConnection += onDeactivateConnection; m_proxyManager.OnConnectionTimeOut += onConnectionTimeOut; m_proxyManager.Start(ipAddress, port, this); }
/// <nodoc/> public void Start(DistributionServices services, EventHandler onConnectionTimeOut) { m_proxyManager = new BondProxyConnectionManager <MasterProxyAdapter>( client: m_bondTcpClient, loggingContext: m_loggingContext, services: services, createProxyCallback: client => new BondMasterClient.MasterProxyAdapter( ResiliencyTestBondTransportClient.TryWrapClientForTest(DistributedBuildRoles.Worker, client))); m_proxyManager.OnConnectionTimeOut += onConnectionTimeOut; m_proxyManager.Start(m_ipAddress, m_port, this); }