Socket.ConnectAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| ConnectAsync(SocketAddress) |
Connects this socket to a server on a thread-pool thread, with no connection timeout. |
| ConnectAsync(SocketAddress, Int32) |
Connects this socket to a server on a thread-pool thread, using the specified connection timeout. |
ConnectAsync(SocketAddress)
Connects this socket to a server on a thread-pool thread, with no connection timeout.
public System.Threading.Tasks.Task ConnectAsync(Java.Net.SocketAddress? endpoint);
member this.ConnectAsync : Java.Net.SocketAddress -> System.Threading.Tasks.Task
Parameters
- endpoint
- SocketAddress
The remote socket address, including the IP address and port.
Returns
A task that completes when Connect(SocketAddress) returns and the connection is established.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
ConnectAsync(SocketAddress, Int32)
Connects this socket to a server on a thread-pool thread, using the specified connection timeout.
public System.Threading.Tasks.Task ConnectAsync(Java.Net.SocketAddress? endpoint, int timeout);
member this.ConnectAsync : Java.Net.SocketAddress * int -> System.Threading.Tasks.Task
Parameters
- endpoint
- SocketAddress
The remote socket address, including the IP address and port.
- timeout
- Int32
The connection timeout in milliseconds, or zero to wait without a timeout.
Returns
A task that completes when Connect(SocketAddress, Int32) returns and the connection is established.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.