A task that represents the asynchronous connect operation.
Overloads 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.
RemarksThis method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by Connect().
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
The number of milliseconds to wait for the server to respond before the connection times out.
ReturnsA task that represents the asynchronous connect operation.
RemarksThis method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by Connect(Int32).
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
The token to monitor for cancellation requests. The default value is None.
ReturnsA task that represents the asynchronous connect operation.
ExceptionsThe cancellation token was canceled. This exception is stored into the returned task.
RemarksThis method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by Connect().
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
The number of milliseconds to wait for the server to respond before the connection times out.
The token to monitor for cancellation requests. The default value is None.
ReturnsA task that represents the asynchronous connect operation.
ExceptionsThe cancellation token was canceled. This exception is stored into the returned task.
RemarksThis method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by Connect(Int32).
ConnectAsync(TimeSpan, CancellationToken)Asynchronously connects to a waiting server within the specified timeout period and monitors cancellation requests.
public:
System::Threading::Tasks::Task ^ ConnectAsync(TimeSpan timeout, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task ConnectAsync(TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
member this.ConnectAsync : TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function ConnectAsync (timeout As TimeSpan, cancellationToken As CancellationToken) As Task
Parameters
The amount of time to wait for the server to respond before the connection times out.
The token to monitor for cancellation requests. The default value is None.
ReturnsA task that represents the asynchronous connect operation.
ExceptionsThe cancellation token was canceled. This exception is stored into the returned task.
RemarksThis method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by Connect(TimeSpan).
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4