| Home | Libraries | People | FAQ | More

###### basic_stream::connect (1 of 10 overloads)

Connect the stream to the specified endpoint.

###### Synopsis

    void
    connect(
        endpoint_type const& ep);

###### Description

This function is used to connect the underlying socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.

###### Parameters

Name | Description
--- | ---
`ep` | The remote endpoint to connect to.

###### Exceptions

Type | Thrown On
--- | ---
`system_error` | Thrown on failure.

###### See Also

`connect`