| Home | Libraries | People | FAQ | More

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

Connect the stream to the specified endpoint.

###### Synopsis

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

###### 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.
`ec` | Set to indicate what error occurred, if any.

###### See Also

`connect`