udp and ip
BlitzMax Forums/BlitzMax Beginners Area/udp and ip
| ||
Is there any way to get ip of client, who have router? socketlocalip say 192.168.xxx.xxx for router user and I need to get ip which I can use to connect from other pc that is not connected to that router. Edit: Problem fixed with tcp. connect, get ip, dc :) |
| ||
OK... The computer that is outside the router needs to address the one behind the router using the router's IP address... then you will need to either have that computer (behind the router) in the DMZ or port forwarded (router configuration). |
| ||
Port-forwarding is the safest method. If you don't know how to, you can usually access the router settings by typing its IP address into the address bar of your browser. For example 192.168.0.1 To find the external IP address, try something like www.whatismyip.com |
| ||
Here's some Blitzmax code to get the external router IP: http://www.blitzbasic.com/codearcs/codearcs.php?code=2429#comments |
| ||
Although that code may be useful, I think it's important to point out that all it does is ask an external site (such as www.whatismyip.com - the first example!) for the IP address, and therefore relies upon that site working and being up. You should bear in mind that if the website goes down the code will no longer work. |
| ||
there is no function OpenTCPStream and closetcpstream in blitzmax... |
| ||
Maybe you could have several sites that you use to get the ip address when one or more isn't available, as backups? |
| ||
Hm the sample code posted above is for BlitzBasic and not BlitzMax. |