NamedPipeClientStream.ConnectAsync Method

Definition

A task that represents the asynchronous connect operation.

Overloads

ConnectAsync()

Asynchronously connects to a waiting server with an infinite timeout period.

ConnectAsync(Int32)

Asynchronously connects to a waiting server within the specified timeout period.

ConnectAsync(CancellationToken)

Asynchronously connects to a waiting server and monitors cancellation requests.

ConnectAsync(Int32, CancellationToken)

Asynchronously connects to a waiting server within the specified timeout period and monitors cancellation requests.

ConnectAsync()

Asynchronously connects to a waiting server with an infinite timeout period.

public:
 System::Threading::Tasks::Task ^ ConnectAsync();
public System.Threading.Tasks.Task ConnectAsync ();
member this.ConnectAsync : unit -> System.Threading.Tasks.Task
Public Function ConnectAsync () As Task

Returns

A task that represents the asynchronous connect operation.

ConnectAsync(Int32)

Asynchronously connects to a waiting server within the specified timeout period.

public:
 System::Threading::Tasks::Task ^ ConnectAsync(int timeout);
public System.Threading.Tasks.Task ConnectAsync (int timeout);
member this.ConnectAsync : int -> System.Threading.Tasks.Task
Public Function ConnectAsync (timeout As Integer) As Task

Parameters

timeout
Int32

The number of milliseconds to wait for the server to respond before the connection times out.

Returns

A task that represents the asynchronous connect operation.

ConnectAsync(CancellationToken)

Asynchronously connects to a waiting server and monitors cancellation requests.

public:
 System::Threading::Tasks::Task ^ ConnectAsync(System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task ConnectAsync (System.Threading.CancellationToken cancellationToken);
member this.ConnectAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function ConnectAsync (cancellationToken As CancellationToken) As Task

Parameters

cancellationToken
CancellationToken

The token to monitor for cancellation requests. The default value is None.

Returns

A task that represents the asynchronous connect operation.

ConnectAsync(Int32, CancellationToken)

Asynchronously connects to a waiting server within the specified timeout period and monitors cancellation requests.

public:
 System::Threading::Tasks::Task ^ ConnectAsync(int timeout, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task ConnectAsync (int timeout, System.Threading.CancellationToken cancellationToken);
member this.ConnectAsync : int * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function ConnectAsync (timeout As Integer, cancellationToken As CancellationToken) As Task

Parameters

timeout
Int32

The number of milliseconds to wait for the server to respond before the connection times out.

cancellationToken
CancellationToken

The token to monitor for cancellation requests. The default value is None.

Returns

A task that represents the asynchronous connect operation.

Applies to