Connect()

TcpClient::Connect(String, int32_t) method

Establishes a connection to the specified remote host.

void System::Net::Sockets::TcpClient::Connect(String hostname, int32_t port)

Arguments

ParameterTypeDescription
hostnameStringA remote host name to connect.
portint32_tA port of the remote host to connect.

TcpClient::Connect(System::SharedPtr<IPAddress>, int32_t) method

Establishes a connection to the specified remote host.

void System::Net::Sockets::TcpClient::Connect(System::SharedPtr<IPAddress> address, int32_t port)

Arguments

ParameterTypeDescription
addressSystem::SharedPtr<IPAddress>The IP address of a remote host.
portint32_tA port of the remote host to connect.

TcpClient::Connect(System::SharedPtr<IPEndPoint>) method

Establishes a connection to the specified remote host.

void System::Net::Sockets::TcpClient::Connect(System::SharedPtr<IPEndPoint> remoteEP)

Arguments

ParameterTypeDescription
remoteEPSystem::SharedPtr<IPEndPoint>A remote host to connect.

TcpClient::Connect(System::ArrayPtr<System::SharedPtr<IPAddress>>, int32_t) method

Establishes a connection to the specified remote host.

void System::Net::Sockets::TcpClient::Connect(System::ArrayPtr<System::SharedPtr<IPAddress>> ipAddresses, int32_t port)

Arguments

ParameterTypeDescription
ipAddressesSystem::ArrayPtr<System::SharedPtr<IPAddress>>The IP addresses of a remote host.
portint32_tA port of the remote host to connect.

See Also