Get Info abaut client in the LAN
BlitzMax Forums/BlitzMax Programming/Get Info abaut client in the LAN
| ||
Can i get information about all the Clients where are in my LAN connected. IP, Computername etc. |
| ||
I would like to know this too - how networking on a LAN is different from over the internet. |
| ||
One pointer: If you find out your own IP address, you can broadcast a message to all computers in the same subnet by sending a message to the broadcast IP -- typically .255 in your subnet. e.g. if your own IP happens to be 192.168.17.4, you can reach all computers in your subnet by sending a message to 192.168.17.255 (Note: If you have divided your subnets into smaller chunks, the broadcast IP will be different and you need to know the netmask for your segment to find out what it is... Not sure how to obtain your netmask from within Blitz) Anyway, if you broadcast a message to .255, every computer on your lan segment will receive it. If you are looking at making some kind of network game, you can have a computer that hosts a game server broadcast itself to .255, and have the client computers listen for the incoming signal, and report back their respective info to the gameserver host. It can then arange the direct peer-to-peer communications from there on out. |
| ||
Like xlsior said, you need to know the subnet mask. The only way to do this from Blitz AKAIK is to parse the output from ipconfig (or write a similar tool using API functions). |
| ||
Like xlsior said, you need to know the subnet mask. The only way to do this from Blitz AKAIK is to parse the output from ipconfig (or write a similar tool using API functions). ...which really ought to be part of the Blitz command set, just like how it can obtain your own local IP... knowing the netmask is crucial for compatibility with lan gaming, or any divided subnet will cause problems with any auto-detect you can create... (Unless you brute-force the whole block, which is a really bad idea and can easily bleed over in neighboring networks that don't belong to you, if you are indeed in a divided block) |