NamedPipeServerStream::BeginWaitForConnection Method (AsyncCallback^, Object^)
.NET Framework (current version)
Begins an asynchronous operation to wait for a client to connect.
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.
| 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
Available since 3.5
Show: