CommunicationObject::OnClose Method (TimeSpan)
Inserts processing on a communication object after it transitions to the closing state due to the invocation of a synchronous close operation.
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.
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0