CommunicationObject.OnClose Method
Inserts processing on a communication object after it transitions to the closing state due to the invocation of a synchronous close operation.
Namespace: System.ServiceModel.Channels
Assembly: System.ServiceModel (in System.ServiceModel.dll)
| Exception | Condition |
|---|---|
| CommunicationObjectFaultedException | |
| TimeoutException | The default interval of time that was allotted for the operation was exceeded before the operation was completed. |
| CommunicationException | A communication error occurred while closing the object. |
The Close method calls OnClose if the communication object is initially in the Opened state.
To insert processing after a communication object transitions to a closing state due to the invocation of an asynchronous BeginClose operation, use the OnBeginClose method.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.