Export (0) Print
Expand All

ICommunicationObject.Open Method (TimeSpan)

Causes a communication object to transition from the created state into the opened state within a specified interval of time.

Namespace: System.ServiceModel
Assembly: System.ServiceModel (in system.servicemodel.dll)

void Open (
	TimeSpan timeout
)
void Open (
	TimeSpan timeout
)
function Open (
	timeout : TimeSpan
)
Not applicable.

Parameters

timeout

The Timespan that specifies how long the send operation has to complete before timing out.

Exception typeCondition

CommunicationException

The ICommunicationObject was unable to be opened and has entered the Faulted state.

TimeoutException

The specified timeout elapsed before the ICommunicationObject was able to enter the Opened state and has entered the Faulted state.

When an ICommunicationObject is instantiated, it begins in the Created state. In the Created state, the object can be configured (for example, properties can be set, or events can be registered), but it is not yet usable to send or receive messages. The Open method causes an ICommunicationObject to enter into the Opening state where it remains until the open operation succeeds, the open operation times out or fails and the object becomes faulted, or the ICommunicationObject is aborted.

In the Opened state, the ICommunicationObject is usable (for example, messages can be received), but it is no longer configurable.

There is also an asynchronous version of the open method that is initiated by calling BeginOpen and completed by calling EndOpen.

Notes to Implementers: The operation must throw a TimeoutException if the specified timeout is exceeded.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft