Socket
(1) basic_stream_socket
:
This socket provides sequenced, reliable, two-way connection based byte streams. tcp::socket
is an instance of this socket:
(2) basic_datagram_socket
:
This socket provides connectionless, datagram service. udp::socket
is an instance of this socket:
class udp
{
......
/// The UDP socket type.
}
(4) basic_seq_packet_socket
:
This socket combines stream and datagram: it provides a sequenced, reliable, two-way connection based datagrams service. SCTP is an example of this type of service.
All these 4
sockets derive from basic_socket
class, and need to associate with an io_context
during initialization. Take tcp::socket
as an example:
boost::asio::io_context io_context;
For basic_io_object
class, it does not support copy constructed/copy assignment:
private:
basic_io_object(const basic_io_object&);
void operator=(const basic_io_object&);
......
whilst it can be movable: