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:

    1. class udp
    2. {
    3. ......
    4. /// The UDP socket type.
    5. }

    (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:

    1. boost::asio::io_context io_context;

    For basic_io_object class, it does not support copy constructed/copy assignment:

    1. private:
    2. basic_io_object(const basic_io_object&);
    3. void operator=(const basic_io_object&);
    4. ......

    whilst it can be movable: