public void Destroy() { Disconnect(); if (_clientHost != null) { if (_clientHostOpened) { _clientHost.Close(); } _clientHost = null; _contractInstance.Close(); _contractInstance = null; } DestroyClientRepository(); ConnectionStringHolder.Close(); }
private void CreateClientHost() { IServiceDescriptor clientDescriptor = new ClientConfiguration(_clientConfiguration.ClientPort); string uriClient = Infrastructure.GetEndpointUrl(clientDescriptor); _contractInstance = new ClientContract(_infrastructureCallback, CheckClient); _clientHost = new ServiceHost(_contractInstance, new Uri(uriClient)); Infrastructure.AddServiceBehaviors(_clientHost.Description); _clientHost.AddServiceEndpoint( typeof(IClientInfrastructure), Infrastructure.CreateApplicationBinding(false), Constants.ClientAccessContract ); _clientHost.Open(); }