|
-
Dec 16th, 2006, 08:21 AM
#1
Thread Starter
Member
Re: Accessing Computer using Internet through NAT
"when you have to send data to your friend's computer you save that data to a specific file on your computer. Then your program - running on your friend's computer - connects to your computer, gets that file, and uses the data in the file."
I don't think that is possible with my program. My program needs to upload and download data quickly over the internet in real time. Saving a file and having the other computer to continually check it every 15 milliseconds is going to create unnecessary lag. I'll need to set up that router myself for my program to work, because my friend does not know how to.
I have another question I need for my program.
Is there any way to find the external IP from the program itself? I need the program to be independent of finding its external IP address. Right now I can only find the internal IP address, and I need to find the address of the router, not the computer that is behind the router.
-
Dec 16th, 2006, 11:30 AM
#2
Re: Accessing Computer using Internet through NAT
 Originally Posted by evan29
Is there any way to find the external IP from the program itself? I need the program to be independent of finding its external IP address. Right now I can only find the internal IP address, and I need to find the address of the router, not the computer that is behind the router.
Windows doesn't provide a reliable way to get your external IP address. Winsock.LocalIP will return the internal IP address, unless the person is not behind a NAT/router. You would have to get it from your router (good luck) or from a webserver like www.showmyip.com
You can get the router's IP, which is the Default Gateway/Subnet Mask, by using the command prompt. I'm sure there's other ways to do it through code, but that's the only way I know of.
ipconfig /all
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|