Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>That's not really broadcast, since you're giving the server's address, rather than the broadcast address (<code>255.255.255.255</code>, or whatever your local network broadcast address is (like <code>192.168.1.255</code>, if your network segment is <code>192.168.1.0/24</code>).</p> <p>You also may consider that you could have a firewall blocking incoming UDP packets on your server port. You should look at the documentation for DatagramSocket/DatagramPacket to see if there's a magic incantation for binding the server socket properly, or sending the packet from the client properly.</p> <p>[<strong>Edit</strong>: How to find the network broadcast] The network broadcast address can be found once you know the network address, both of which you can tell from your IP and subnet mask. The subnet mask basically shows how much of the address is the network, and how much is the client. (subnet mask is often written as "netmask") An example:</p> <p>IP: 192.168.1.101 Netmask: 255.255.255.0 Network Address (CIDR): 192.168.1.0/24 Broadcast Address: 192.168.1.255</p> <p>or:</p> <p>IP: 10.13.28.55 Netmask: 255.255.0.0 Network: 10.13.0.0/16 Broadcast Address: 10.13.255.255</p> <p>So essentially, the network address has a bunch of zeroes at the end, and the broadcast address replaces them with ones.</p> <p>IPv4 Addresses are 32-bit numbers (easiest to think of them as unsigned. If you do the bitwise-AND of your address and the netmask, you get the network address. If you bitwise-OR that with the bitwise-NOT of the netmask, you get the broadcast address (so <code>(addr &amp; netmask) | ~netmask)</code> would get you the local broadcast).</p> <p><code>255.255.255.255</code> (or <code>0xFFFFFFFF</code>) is the global broadcast address. IP broadcasts don't cross network segments, so it's safe to send to it, though.</p>
 

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