System.Net.Sockets.TcpClient.ConnectAsync C# (CSharp) Method

ConnectAsync() public method

public ConnectAsync ( string host, int port ) : System.Threading.Tasks.Task
host string
port int
return System.Threading.Tasks.Task
        public Task ConnectAsync(string host, int port) => ConnectAsyncCore(host, port);

Same methods

TcpClient::ConnectAsync ( IPAddress address, int port ) : System.Threading.Tasks.Task

Usage Example

Example #1
0
	    public async Task<TcpClient> ConnectAsync(string hostname, int port)
	    {
	        TcpClient client = new TcpClient();
	        await client.ConnectAsync(hostname, port);
	        DoHandshake(client, hostname, port);
	        return client;
	    } 
All Usage Examples Of System.Net.Sockets.TcpClient::ConnectAsync