boost::asio::basic_stream_socket

Provides stream‐oriented socket functionality.

Synopsis

Declared in <boost/asio/basic_stream_socket.hpp>

template<
    typename Protocol,
    typename Executor = any_io_executor>
class basic_stream_socket
    : public basic_socket<Protocol, Executor>

Base Classes

Name

Description

basic_socket<Protocol, Executor>

Provides socket functionality.

Types

Name

Description

rebind_executor

Rebinds the socket type to another executor.

endpoint_type

The endpoint type.

executor_type

The type of the executor associated with the object.

native_handle_type

protocol_type

The protocol type.

Member Functions

Name

Description

basic_stream_socket [constructor]

Constructors

~basic_stream_socket [destructor]

Destroys the socket.

operator=

Assignment operators

async_read_some

Start an asynchronous read.

async_receive

Start an asynchronous receive.

async_send

Start an asynchronous send.

async_write_some

Start an asynchronous write.

read_some

Read some data from the socket.

receive

receive overloads

send

Send some data on the socket.

write_some

Write some data to the socket.

Non-Member Functions

Name

Description

async_connect

Asynchronously establishes a socket connection by trying each endpoint in a sequence.

async_connect

Asynchronously establishes a socket connection by trying each endpoint in a sequence.

async_connect

Asynchronously establishes a socket connection by trying each endpoint in a sequence.

async_connect

Asynchronously establishes a socket connection by trying each endpoint in a sequence.

connect

Establishes a socket connection by trying each endpoint in a sequence.

connect

Establishes a socket connection by trying each endpoint in a sequence.

connect

Establishes a socket connection by trying each endpoint in a sequence.

connect

Establishes a socket connection by trying each endpoint in a sequence.

connect

Establishes a socket connection by trying each endpoint in a sequence.

connect

Establishes a socket connection by trying each endpoint in a sequence.

connect

Establishes a socket connection by trying each endpoint in a sequence.

connect

Establishes a socket connection by trying each endpoint in a sequence.

local::connect_pair

Create a pair of connected sockets.

local::connect_pair

Create a pair of connected sockets.

Description

The basic_stream_socket class template provides asynchronous and blocking stream‐oriented socket functionality.

Thread Safety

Distinct objects: Safe. Shared objects: Unsafe.

Synchronous send, receive, connect, and shutdown operations are thread safe with respect to each other, if the underlying operating system calls are also thread safe. This means that it is permitted to perform concurrent calls to these synchronous operations on a single socket object. Other synchronous operations, such as open or close, are not thread safe.

Concepts:

AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream.

Created with MrDocs