websocketpp icon indicating copy to clipboard operation
websocketpp copied to clipboard

tcp::no_delay option(true) on a class (WebSocket++/0.8.3-dev)

Open pha377 opened this issue 3 years ago • 1 comments

I made a class:

This is the constructor:

clsClient() {
     client_.set_socket_init_handler(bind(&clsClient::on_socket_init, this, ::_1, ::_2));
}

and the on_socket_init() method:

void on_socket_init(hdlt hdl, boost::asio::ip::tcp::socket& s) {
    std::cout << "Socket Initialized" << std::endl;
    websocketpp::lib::asio::ip::tcp::no_delay option(true);
    s.set_option(option);
}

but bind on the constructor gives me error

(WebSocket++/0.8.3-dev)

pha377 avatar Mar 01 '23 01:03 pha377

I have also encountered this problem, after I bind the callback function triggers a direct crash Have you solved this problem?

harryGuo133 avatar May 27 '24 03:05 harryGuo133