简体   繁体   English

使用特定的以太网接口提升 asio 套接字组播发送数据

[英]Boost asio socket multicast send data with a specific ethernet interface

boost::asio::ip::address_v4 local_interface = 
boost::asio::ip::address_v4::from_string(ip);
boost::asio::ip::multicast::outbound_interface option(local_interface);
sock.set_option(option); //set interface

It does not work!这是行不通的! I used wireshark to capture data, but the data source interface is not the local_interface, why???我用wireshark抓数据,但是数据源接口不是local_interface,为什么??? and How to make it working?以及如何使它工作?

WSOCK32.DLL WS2_32.DLL both exist in a program. WSOCK32.DLL WS2_32.DLL 都存在于一个程序中。 We can set VS project linker input: Ignore specific default libraries(the WSOCK32.DLL).我们可以设置 VS 项目链接器输入:忽略特定的默认库(WSOCK32.DLL)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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