Is there any way to get the native socket descriptor from the connection or connection_ptr in websocketpp? I need to set the TCP_CORK before I send the frame to the client. I am new to Boost.Asio please advise.

有帮助吗?

解决方案

From following the github code, you can likely call connection_ptr->get_raw_socket().native_handle().

websocketpp::connection inherits from websocketpp::socket::connection, and websocket::socket::connection provides a get_socket() public member function that returns a reference to a Boost.Asio socket. Boost.Asio sockets provide a native_handle() member function that returns the native socket representation.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top