Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8727623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:28:12+00:00 2026-06-13T08:28:12+00:00

I want Peer(s) to be able to send DatagramPackets over a WIFI LAN for

  • 0

I want Peer(s) to be able to send DatagramPackets over a WIFI LAN for the sole purpose of discovering other Peers. So, I have each Peer made up of a Client(Sending packets) and a Server (listening for packets).

I have only been able to get this to work by using IPConfig on each machine to get their respective IPv4 Address and then using that as a paramter for the creation of the DatagramPacket:-

InetAddress server = InetAddress.getByName("THE IPv4 ADDRESS OF THE PEER'S SERVER
                                            RUNNING ON THE OTHER MACHINE");

DatagramPacket sendPacket = new DatagramPacket(outBuffer, outBuffer.length,
                                               server, serverPort);

Am I using broadcast (for peer discovery) in the right way here because it seems pretty rubbish to me if I am? I was under the assumption I could have a client on machineA fire off a packet into the LAN abyss and the Server running on machineB would be listening to the entire LAN and detect the packet. At the moment all I’m doing is manually using IPConfig on the machine running the server and typing that address in the DatagramPacket on the machine running the client, which just seems pointless.

I can use multicast just fine but I think broadcast is more what I need for peer discovery.

Help appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:28:13+00:00Added an answer on June 13, 2026 at 8:28 am

    Use the broadcast address 255.255.255.255 for both server and client.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to send broadcast message to all peers in my local network. Message
Two machines, each running mysql, each synchronized to the other peer-to-peer. I do not
I want to make connection between two devices over WiFi using GameKit. Apple's documentation
I have an object that I want to send to another device via bluetooth.
Want to run javascript function from parent window in child window Example I have
want to have a Hyperlink-Button in a gridView in which I can display a
Want to be able to provide a search interface for a collection of objects
I want to code a peer-to-peer like chat program in C#. I am trying
I have Adjacency list mode structure like that and i want to count all
I want to attempt to write a peer to peer chat client that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.