/// <summary> /// /// </summary> public void Stop() { lock (SyncRoot) { if (ServerHost != null) { if (ServerHost.State != CommunicationState.Faulted) { ServerHost.Close(TimeSpan.FromSeconds(1)); } else { ServerHost.Abort(); } ServerHost = null; } } }