/// <summary> /// Dispose /// </summary> public void Dispose(bool disposing) { if (!_disposed) { if (disposing) { lock (_locker) { if (null != _channel) { ((IClientChannel)_channel).Abort(); _channel = null; } if (null != _factory) { _factory.Abort(); _factory = null; } _endpoint = null; _binding = null; } _disposed = true; } } }
/// <summary> /// Public creator /// </summary> public bool Create() { bool rc = false; try { _binding = new NetNamedPipeBinding(); _endpoint = new EndpointAddress("net.pipe://localhost/mcneel/sockeyeserver/1/server/pipe"); _factory = new ChannelFactory<ISockeyeService>(_binding, _endpoint); _channel = _factory.CreateChannel(); rc = true; } catch (Exception ex) { ThrowCreationException(ex); Dispose(); } return rc; }
/// <summary> /// Public creator /// </summary> public bool Create() { bool rc = false; try { _binding = new NetNamedPipeBinding(); _endpoint = new EndpointAddress("net.pipe://localhost/mcneel/sockeyeserver/1/server/pipe"); _factory = new ChannelFactory <ISockeyeService>(_binding, _endpoint); _channel = _factory.CreateChannel(); rc = true; } catch (Exception ex) { ThrowCreationException(ex); Dispose(); } return(rc); }