Comments (5)
I would like to send broadcast on all interfaces.
I've already tried using 255.255.255.255 IP but that doesn't seem to work.
from libcluon.
Also seems like even doing something like 192.168.188.255 doesn't work.
So is there no way of sending broadcasts?
from libcluon.
Hi, just for me to understand: do you want to send data via broadcast using UDPSender or do you want to receive data sent from somewhere via broadcast using UDPReceiver?
from libcluon.
I'd like to send broadcast on all connected interfaces. For example when I'm connected to WiFi and Ethernet, I'd like to send broadcast on both of these interfaces.
Creating broadcasting sockets on every interface looks something like this in boost::asio:
std::vector<ba::ip::udp::socket> sockets {};
// Open one socket for every network interface
ba::io_service io_service;
ba::ip::tcp::resolver resolver(io_service);
ba::ip::tcp::resolver::query query(ba::ip::host_name(), "");
auto it = resolver.resolve(query);
while (it != ba::ip::tcp::resolver::iterator()) {
auto addr = (it++)->endpoint().address();
if (addr.is_v4()) {
ba::ip::udp::socket socket { m_ctx };
boost::system::error_code ec;
socket.open(ba::ip::udp::v4(), ec);
if (ec) {
BOOST_LOG_TRIVIAL(error) << "Unable to create broadcast socket on "
<< addr.to_string() << ": " << ec.message();
} else {
socket.set_option(ba::ip::udp::socket::reuse_address(true));
socket.set_option(ba::socket_base::broadcast(true));
socket.bind(ba::ip::udp::endpoint(addr, 0));
sockets.push_back(std::move(socket));
}
}
}
Also it seems like at the moment there is actually no way to send broadcast at all even when knowing the exact network address. I've tried creating UDPSender with address 192.168.188.255 (my ip was 192.168.188.21 with mask 255.255.255.0), but wireshark didn't intercept anything. I was only able to see any udp traffic when i chose unicast address as an endpoint.
from libcluon.
Added as of https://github.com/chrberger/libcluon/releases/tag/v0.0.128
from libcluon.
Related Issues (17)
- [BUILD] Release 0.0.74 does not build HOT 5
- Warning from compiler: maybe-uninitialized (Version: 0.0.121) HOT 1
- Time.hpp use system_clock that can be adjusted at any time by the system HOT 1
- Unable to compile single header on Windows HOT 12
- libcluon is using an old version of the stringtoolbox library HOT 1
- Compiler warning: -Wreturn-type (v0.0.140) HOT 1
- No switch for disabling the tests in a CMake build? HOT 1
- Support for rdma and rpmem as destinations. HOT 1
- Tutorials are non functional due to online compiler error HOT 2
- Could you please add the cluon-complete.hpp to the release file? HOT 2
- Compatibility problems with newer versions of dependencies HOT 2
- How to add a vector<double> data type to an ODVD file๏ผ HOT 1
- How can one efficiently transmit substantial volumes of data? HOT 1
- Is there a form akin to RPC for such purposes? HOT 1
- Messages specifications for Protobuf, MsgPack, ODVD, ... HOT 1
- Feature request/clarification - C++ generated enum of message types HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libcluon.