NamedPipeServerStream::BeginWaitForConnection Method (AsyncCallback^, Object^)

 

Begins an asynchronous operation to wait for a client to connect.

Namespace:   System.IO.Pipes
Assembly:  System.Core (in System.Core.dll)

public:
[SecurityCriticalAttribute]
[HostProtectionAttribute(SecurityAction::LinkDemand, ExternalThreading = true)]
IAsyncResult^ BeginWaitForConnection(
	AsyncCallback^ callback,
	Object^ state
)

Parameters

callback
Type: System::AsyncCallback^

The method to call when a client connects to the NamedPipeServerStream object.

state
Type: System::Object^

A user-provided object that distinguishes this particular asynchronous request from other requests.

Return Value

Type: System::IAsyncResult^

An object that references the asynchronous request.

Exception Condition
InvalidOperationException

The pipe was not opened asynchronously.

-or-

A pipe connection has already been established.

-or-

The pipe handle has not been set.

IOException

The pipe connection has been broken.

ObjectDisposedException

The pipe is closed.

This is the asynchronous equivalent of WaitForConnection.

EndWaitForConnection must be called exactly once for every call to BeginWaitForConnection.

.NET Framework
Available since 3.5
Return to top
Show: