| Home | Libraries | People | FAQ | More

### ip::basic_endpoint

Describes an endpoint for a version-independent IP socket.

    template<
        typename InternetProtocol>
    class basic_endpoint

##### Types

Name | Description
--- | ---
data_type | The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer.
protocol_type | The protocol type associated with the endpoint.

##### Member Functions

Name | Description
--- | ---
address | Get the IP address associated with the endpoint. Set the IP address associated with the endpoint.

basic_endpoint

Default constructor.

Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections.

Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.

Copy constructor.

capacity | Get the capacity of the endpoint in the native type.
data | Get the underlying endpoint in the native type.
operator= | Assign from another endpoint.
port | Get the port associated with the endpoint. The port number is always in the host's byte order. Set the port associated with the endpoint. The port number is always in the host's byte order.
protocol | The protocol associated with the endpoint.
resize | Set the underlying size of the endpoint in the native type.
size | Get the underlying size of the endpoint in the native type.

##### Friends

Name | Description
--- | ---
operator!= | Compare two endpoints for inequality.
operator< | Compare endpoints for ordering.
operator== | Compare two endpoints for equality.

##### Related Functions

Name | Description
--- | ---
operator<< | Output an endpoint as a string.

The `ip::basic_endpoint` class template describes an endpoint that may be associated with a particular socket.

##### Thread Safety

Distinct objects: Safe.

Shared objects: Unsafe.

##### Requirements

Header: `boost/asio/ip/basic_endpoint.hpp`

Convenience header: `boost/asio.hpp`