## TcpClient::Connect(String, int32_t) method


Establishes a connection to the specified remote host.

```cpp
void System::Net::Sockets::TcpClient::Connect(String hostname, int32_t port)
```


| Parameter | Type | Description |
| --- | --- | --- |
| hostname | String | A remote host name to connect. |
| port | int32_t | A port of the remote host to connect. |

## See Also

* Class [String](../../../system/string/)
* Class [TcpClient](../)
* Namespace [System::Net::Sockets](../../)
* Library [Aspose.PDF for C++](../../../)
## TcpClient::Connect(System::ArrayPtr\<System::SharedPtr\<IPAddress\>\>, int32_t) method


Establishes a connection to the specified remote host.

```cpp
void System::Net::Sockets::TcpClient::Connect(System::ArrayPtr<System::SharedPtr<IPAddress>> ipAddresses, int32_t port)
```


| Parameter | Type | Description |
| --- | --- | --- |
| ipAddresses | System::ArrayPtr\<System::SharedPtr\<IPAddress\>\> | The IP addresses of a remote host. |
| port | int32_t | A port of the remote host to connect. |

## See Also

* Typedef [ArrayPtr](../../../system/arrayptr/)
* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [IPAddress](../../../system.net/ipaddress/)
* Class [TcpClient](../)
* Namespace [System::Net::Sockets](../../)
* Library [Aspose.PDF for C++](../../../)
## TcpClient::Connect(System::SharedPtr\<IPAddress\>, int32_t) method


Establishes a connection to the specified remote host.

```cpp
void System::Net::Sockets::TcpClient::Connect(System::SharedPtr<IPAddress> address, int32_t port)
```


| Parameter | Type | Description |
| --- | --- | --- |
| address | System::SharedPtr\<IPAddress\> | The IP address of a remote host. |
| port | int32_t | A port of the remote host to connect. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [IPAddress](../../../system.net/ipaddress/)
* Class [TcpClient](../)
* Namespace [System::Net::Sockets](../../)
* Library [Aspose.PDF for C++](../../../)
## TcpClient::Connect(System::SharedPtr\<IPEndPoint\>) method


Establishes a connection to the specified remote host.

```cpp
void System::Net::Sockets::TcpClient::Connect(System::SharedPtr<IPEndPoint> remoteEP)
```


| Parameter | Type | Description |
| --- | --- | --- |
| remoteEP | System::SharedPtr\<IPEndPoint\> | A remote host to connect. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [IPEndPoint](../../../system.net/ipendpoint/)
* Class [TcpClient](../)
* Namespace [System::Net::Sockets](../../)
* Library [Aspose.PDF for C++](../../../)
