Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One method of doing this is via UDP broadcast packets. See <a href="http://beej.us/guide/bgnet/output/html/multipage/advanced.html#broadcast" rel="nofollow">beej's guide</a> if you're using BSD sockets. And <a href="http://msdn.microsoft.com/en-us/library/tst0kwb1.aspx" rel="nofollow">here</a> is Microsoft's version of the same.</p> <p>Assuming all the clients of the application are on the same side of a router then a broadcast address of <code>255.255.255.255</code> (or <code>ff02::1</code> for IPv6) should be more than adequate. </p> <p>Multicast is another option, but if this is a LAN-only thing I don't think that's necessary.</p> <h2>Suggestion</h2> <p>Pick a UDP port number (say for the sake of an example we pick 1667). The client should listen to UDP messages on <code>255.255.255.255:1667</code> (or whatever the equivalent is. e.g.: <code>IPEndPoint(IPAddress.Any, 1667)</code>). The server should broadcast messages on the same address.</p> <h2>Format Suggestion</h2> <p>UDP Packet: First four bytes as a magic number, next four bytes an IPv4 address (and you might want to add other things like a server name).</p> <p>The magic number is just in case there is a collision with another application using the same port. Check both the length of the packet and the magic number.</p> <p>Server would broadcast the packet at something like 30 second time intervals. (Alternatively you could have the server send a response only when a client sends a request via broadcast.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload