SocketImpl.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(InetAddress, Int32) |
Runs Connect(InetAddress, Int32) on a thread-pool thread to connect to the remote host. |
| ConnectAsync(SocketAddress, Int32) |
Runs Connect(SocketAddress, Int32) on a thread-pool thread, using the specified connection timeout. |
| ConnectAsync(String, Int32) |
Runs Connect(String, Int32) on a thread-pool thread to connect to the named host. |
ConnectAsync(InetAddress, Int32)
Runs Connect(InetAddress, Int32) on a thread-pool thread to connect to the remote host.
protected System.Threading.Tasks.Task ConnectAsync(Java.Net.InetAddress? address, int port);
member this.ConnectAsync : Java.Net.InetAddress * int -> System.Threading.Tasks.Task
Parameters
- address
- InetAddress
The IP address of the remote host.
- port
- Int32
The port number on the remote host.
Returns
A task that completes when Connect(InetAddress, Int32) returns.
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)
Runs Connect(SocketAddress, Int32) on a thread-pool thread, using the specified connection timeout.
protected System.Threading.Tasks.Task ConnectAsync(Java.Net.SocketAddress? address, int timeout);
member this.ConnectAsync : Java.Net.SocketAddress * int -> System.Threading.Tasks.Task
Parameters
- address
- 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.
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(String, Int32)
Runs Connect(String, Int32) on a thread-pool thread to connect to the named host.
protected System.Threading.Tasks.Task ConnectAsync(string? host, int port);
member this.ConnectAsync : string * int -> System.Threading.Tasks.Task
Parameters
- host
- String
The name of the remote host.
- port
- Int32
The port number on the remote host.
Returns
A task that completes when Connect(String, Int32) returns.
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.