asio C++ library

PrevUpHomeNext

generic::stream_protocol

Encapsulates the flags needed for a generic stream-oriented socket.

class stream_protocol
Types

Name

Description

endpoint

The type of an endpoint.

iostream

The generic socket iostream type.

socket

The generic socket type.

Member Functions

Name

Description

family

Obtain an identifier for the protocol family.

protocol

Obtain an identifier for the protocol.

stream_protocol

Construct a protocol object for a specific address family and protocol.

Construct a generic protocol object from a specific protocol.

type

Obtain an identifier for the type of the protocol.

Friends

Name

Description

operator!=

Compare two protocols for inequality.

operator==

Compare two protocols for equality.

The generic::stream_protocol class contains flags necessary for stream-oriented sockets of any address family and protocol.

Examples

Constructing using a native address family and socket protocol:

stream_protocol p(AF_INET, IPPROTO_TCP);

Constructing from a specific protocol type:

stream_protocol p(asio::ip::tcp::v4());
Thread Safety

Distinct objects: Safe.

Shared objects: Safe.

Requirements

Header: asio/generic/stream_protocol.hpp

Convenience header: asio.hpp


PrevUpHomeNext