Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Find a Server of unknown IP

 
Rancher
Posts: 1022
27
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I find a server that I do not know the IP for?

Scenario: Friends come over and we all get a wifi connect and one of us will host, so the others will be clients. We are all going to be on the same subnet, is there a way short of trying every IP in a range to see if the host is there or manually looking up the IP and saying: "Hey everyone I'm going to be the host tonight, so everyone..."
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One way to do this is a UDP multicast or broadcast.
In multicast, the application running on all devices joins a hardcoded multicast IP address and listens. One of the devices decides to become the server and advertises itself by sending its IP address in a UDP to the multicast address. The router then forwards that UDP to all members of the multicast group.
Same with broadcast, except that router forwards that packet to all devices on the subnet, and whoever's listening on broadcast address receives it.

A more formal way of doing the same thing is using SSDP (Simple Service Discovery Protocol), which also uses multicasting.
 
Les Morgan
Rancher
Posts: 1022
27
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds perfect for what I want. Thank you.

Karthik Shiraly wrote:One way to do this is a UDP multicast or broadcast.
In multicast, the application running on all devices joins a hardcoded multicast IP address and listens. One of the devices decides to become the server and advertises itself by sending its IP address in a UDP to the multicast address. The router then forwards that UDP to all members of the multicast group.
Same with broadcast, except that router forwards that packet to all devices on the subnet, and whoever's listening on broadcast address receives it.

A more formal way of doing the same thing is using SSDP (Simple Service Discovery Protocol), which also uses multicasting.

 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic