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