How do I broadcast in adhoc networks?

How do I broadcast a message from a single source to all nodes, and from multiple sources to all nodes?

Are there any libraries in java that may help?

Asked by: Emily742 | Posted: 21-01-2022

Answer 1

You could look into a distributed messaging framework such as JMS. One Open Source implementation of the protocol is Active MQ:

Answered by: Roman557 | Posted: 22-02-2022

Similar questions

sockets - How to Broadcast to a shutdown system using java?

We use socket.send(packet) function in java to send a "packet" to a given port. My problem is that i have to send a packet to a shutdown system using UDP protocol. The problem with send() function is that first it verifies whether the host IP is multicast or not. Now my local area network is of broadcast type. So i am having problem is using this function. can anyone please give me a way ?

UDP Broadcast in Java

Morning. I'm pretty new in Java and socket connections but I'm trying to send out a UDP packet/broadcast on on port 8001 to a device. I can get the data to send just fine, however when it comes time to receive the data the connection times out. I have a packet sniffer and I can see the packet send and then the device respond. I'm pretty sure it is a rookie mistake that I'm missing in my co...

java - Android Broadcast Address

I am making a Client Server application for my Android phone. I have created a UDP Server in Python which sits and listens for connections. I can put either the server IP address in directly like and it sends data fine. I can also put in and it find the server on Is ...

java - Strange problem with broadcast receiver in Android

I have just this piece of code which is quite simple. I have a list and in the onCreate method I added some objects to this list to show them on the screen. I have a broadcast receiver which has to enable/disable some elements of the list when there aren't internet connection. The broadcast receiver works good if the connection is lost when the application is already in the screen of this activity. The problem is ...

java - Showing all broadcast events on Android

is it somehow possible to show all broadcast events/intents that are triggered in android? I just want to know if I can quickly figure out if an application is using intents/broadcasts I can hook into. For most of the stock android applications I can read the source but is time consuming.

sockets - Broadcast listener using Java?

I have a DP(data processor, java code) running in my network and few C clients. Client needs to communicate to the DP for data exchange. Client need to discover the DP using broadcast discovery. Client will broadcast a message to which DP will listen and response for availability. I'm not sure how to add listener in Java for the broadcast messages, I tried using DatagramSocket but it asks for port number? DP should listen ...

java - Broadcast Receiver is not starting Service

Thank you in advance for all your help. I am still very new with Android and in the programming world, and was looking for a little guidance. I'm trying to have a text message get listened to, and then kick start a service to run in the background. I know the Broadcast Receiver is working because I have a Toast notification pop up when I send the emulator a text, but that's it. I don't receive anything after that from ...

java - Sink or resend android received broadcast

I have an application that expects SMS messages in certain formats. If a SMS message meets specific criteria set out by my app, I want to prevent the re-broadcast of the SMS, otherwise allow it to proceed to other BroadcastReceiver (like the default SMS reader). Does anyone know how this can be achieved? public void onReceive(Context context, Intent intent) { String msg = processMessageFromInte...

Does Java NIO support broadcast or multicast?

I am searching if Java NIO implements broadcast. I need to create a peer that sends messages to other peers, using multicast or broadcast. I was searching in the API 1.6, but I don't find anything in the DatagramChannel class. Thanks in advance.

java - best practice where to register broadcast receiver?

quick opinion question on where its 'best' to register a receiver? In my case my service sends a broadcast each time the UI needs updating. Options as i understand them . Manifest . Oncreate . Onstart . Onresume With the corresponding unregister of course. I think for a UI update scenario makes sense to put in onresume and onpause... your thoughts?

Still can't find your answer? Check out these amazing Java communities for help...

Java Reddit Community | Java Help Reddit Community | Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)