| Home | Libraries | People | FAQ | More

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

Connect the stream to the specified endpoint.

<h7> Synopsis </h7>

    void
    connect(
        endpoint_type const& ep,
        error_code& ec);

<h7> Description </h7>

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.

<h7> Parameters </h7>

Name | Description
--- | ---
`ep` | The remote endpoint to connect to.
`ec` | Set to indicate what error occurred, if any.

<h7> See Also </h7>

`basic_stream::connect`