protected void DestroyEndpoints() { foreach (var ep in Endpoints.Values.ToArray()) { if (ep != null) ep.Dispose(); } }