No server?

BlitzPlus Forums/BlitzPlus Programming/No server?

Technically you can send a broadcast message to the LAN, and any PC in the subnet will receive it. If the server is among these, it can then respond appropriately.

Unfortunately, there's a snag: While most LAN's use subnets of 256 IP's, that's not always the case. If your own IP is 192.168.1.17, then *most* of the time the broadcast IP that all workstations in the 192.168.1.x range will receive is 192.168.1.255... But that's not set in stone, and many networks use smaller subnets, and some use larger ones.

The broadcast address is the last IP in the subnet -- but to find the size of your subnet and thereby accurately determine the broadcast address, you need the netmask (typically 255.255.255.0)

Unfortunately blitzmax does not come with any built-in commands to obtain your netmask. Without the netmask, you cannot accurately determine your broadcast address.

Of course, port scanning is an option as well, but probably should be used with caution since many networks have a terms of service that prohibit doing that, especially if you're on public IP space and only have a small subnet allocated to you.