https://learn.microsoft.com/pt-pt/dotnet/api/system.servicemodel.channels.communicationobject.onclosed?view=netframework-4.8.1
CommunicationObject.OnClosed Method (System.ServiceModel.Channels) | Microsoft Learn
Invoked during the transition of a communication object into the closing state.
methodsystemchannelsmicrosoftlearn