?
Solved

Broadcast networking

Posted on 2003-03-05
6
Medium Priority
?
331 Views
Last Modified: 2013-11-15
Hi,

We're creating an application to do distributed measurement of application performance that runs on workstations and that we can deploy on our network.

We'd like for these "watchdog" PCs to announce themselves to the nearest data consolidation server.

So, what we'd like to do is have them do some sort of a broadcast to find the servers that exist and are available to receive the data they're collecting.

How would one write a "broadcast" network request (like ARP or a DHCP client request) to announce themselves.  We would know the "port" to use, but not the IP address to direct the message to (it should be anything that responds).

Any example code that does this would be even better.
0
Comment
Question by:klamerus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 2

Accepted Solution

by:
k_suchdeva earned 136 total points
ID: 8073743
Broadcast packets are sent in UDP. You can use UDP classes in java and set the destincation as of the packet as x.y.z.255 and it should be broadcasted to the whole network.

Khem
0
 
LVL 2

Assisted Solution

by:Cicha
Cicha earned 132 total points
ID: 8077881
Hi

Use java.net.MulticastSocket
0
 

Assisted Solution

by:lEx
lEx earned 132 total points
ID: 8078242
String broadcast = "..."; //depends on your network
int port = 1111;

String data = "...";
byte[] buf = data.getBytes();
DatagramSocket socket = new DatagramSocket();
DatagramPacket packet = new DatagramPacket(buf, buf.length,InetAddress.getByName(broadcast),port);
socket.send(packet);


//Packet will send to all computers in network to specified port.
0
 

Expert Comment

by:CleanupPing
ID: 9058906
klamerus:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9762259
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between k_suchdeva, Cicha and IEx

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TimYates
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question