从websocketpp中的connection或connection_ptr获取本机套接字描述符
Get the native socket descriptor from the connection or connection_ptr in websocketpp?
是否有办法从websocketpp
中的connection
或connection_ptr
获得本机套接字描述符?在将帧发送到客户机之前,我需要设置TCP_CORK。我是Boost的新手。请告知。
从下面的github代码,您可能会调用connection_ptr->get_raw_socket().native_handle()
.
websocketpp::connection
继承自websocketpp::socket::connection
, websocket::socket::connection
提供了一个返回Boost引用的get_socket()
public成员函数。Asio插座。提振。Asio套接字提供了一个native_handle()
成员函数,该函数返回本机套接字表示。
相关文章:
- 当套接字连接断开时检测C/C++Unix
- 通过套接字[TCP]传输数据 如何在C / C ++中打包多个整数并使用send() recv()传输数据
- 如何通过套接字将文本文件的内容从服务器发送到客户端
- 如何在C/C++中用FD_set Unix设置套接字文件描述符
- 套接字读取后,我在缓冲区中看到意外输入
- 如何在CPP中创建应该在Windows和Linux上运行的套接字?
- 我可以与 python 服务器而不是 c++ 客户端建立 tcp/ip 套接字吗?
- 套接字连接"Operation not permitted"错误,甚至使用升压/平发器根.cpp
- WINAPI 注册应用程序重新启动时不清除打开的套接字
- (Winsock) UDP 接收工作正常,但同一套接字的发送失败
- MSG_WAITALL的套接字发送得到了 22 EINVAL
- C++套接字客户端到 Python 服务器未创建连接
- 在不知道套接字的情况下关闭网络连接
- C++套接字对不读/写父/子
- 非更新套接字消息
- SIGSEGV on Boost UDP 套接字关闭 - tcache_get at malloc.c.
- 将"uint8_t"(从套接字读取)隐式转换为"char"安全吗
- 当对套接字 send() 的同步调用由于连接另一端丢失而被阻止时,如何恢复?
- 当客户端在 write() 期间终止连接时,由对等套接字错误重置连接
- 从websocketpp中的connection或connection_ptr获取本机套接字描述符