简体   繁体   中英

ASIO ip::tcp::iostream and TCP_NODELAY

How do i set TCP_NODELAY option if i use ip::tcp::iostream? I need a socket for this, but i can't find how to extract it from iostream.

use iostream::rdbuf()

#include <boost/asio.hpp>

int
main()
{
    boost::asio::ip::tcp::iostream stream;
    const boost::asio::ip::tcp::no_delay option( true );
    stream.rdbuf()->set_option( option );
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM