public static async Task ReleaseAll() { Task tc = _clientPool?.ShutdownGracefullyAsync() ?? TaskEx.Completed; Task ts = _serverPool?.ShutdownGracefullyAsync() ?? TaskEx.Completed; await Task.WhenAll(tc, ts); }
protected override void PostStop() { try { RemoteConnection.Shutdown(_connection); RemoteConnection.ReleaseAll().Wait(_settings.ConnectTimeout); } catch (Exception ex) { _log.Error(ex, "Error while terminating RemoteConnection."); } }