   [C++] The Basics help: LAN and Internet clients/servers
  Hi, i am starting with the Sockets programming and i need some info about some things:1) How to get my IP: Ok, i can use IPCONFIG in MSDOS but how i can do this with my app...   1a) I use a internet router, so, i have a internet IP and a Intranet IP, how i can get both.2) LAN Games, how can i scan computers in the intranet to find servers? i know that my intranet IP is 192.168.1.3, all intranets are 192.168.1.x?  2a)What is the maximum number of computers that can be connected in a intranet? it goes from XXX.XXX.XXX.1 to XXX.XXX.XXX.999? in my case the router is XXX.XXX.XXX.1, it will be aways like this? Thanks,Caian.   
  1) don't bother. Your local address is useless.1a) same as (1)2) Don't scan - use a UDP socket and broadcast to the ipaddress 255.255.255.255 on a given port. All machines on the local network with your program can respond with a packet.2a) well, most routers will likely one leave a single octet, which is 8 bits or 0-255 hosts. Better to use the broadcast method, not to port scan.For the answer to (1), the most common solution is to have a third machine on the internet. The machine can be used to mediate between two peers. A resource for this is here. The author (who is the friendly moderator of the network forum) also has a library that achieves the same.   ;  Actually, even better, read the Forum FAQ which answers pretty much all of your questions (and points to references for where the answers are for the rest).;  Thanks!   