-
Oct 5th, 2020, 03:58 PM
#1
Thread Starter
Junior Member
Winsock LocalIP is not the correct IP
There is a winsock app that works between two computers over the internet which has not gotten the IP address correctly from either machine. I use proxy most of the time which gives and ip address which doesn't match with the ip found online and if im off proxy the it would only appear it knows the local ip address to the router versus the ip generated by the dhcp. Its the same effect from either pc. So I can't use this winsock app unless I can set the ip address to send from. The remote ip is possible to enter. BinaryTransfer.zip
-
Oct 5th, 2020, 04:02 PM
#2
Re: Winsock LocalIP is not the correct IP
I remember I did have this issue +10 years ago when I worked on that.
the IP returned was the internal one (not the localhost) but I needed the one that was connectable from internet.
theres a way with a couple API that would do that, but I dont have access to my "old tools" here, I think I have that at home, so if nobody can help u I will dig it up on Wednesday.
-
Oct 6th, 2020, 04:58 PM
#3
Hyperactive Member
Re: Winsock LocalIP is not the correct IP
I'm probably missing something here, but unless you are just binding your listener to the wrong adapter or network, it doesn't sound like there is a solution without going through a third machine. At least one of your IPs needs to be known and routable after all.
-
Oct 6th, 2020, 06:11 PM
#4
Re: Winsock LocalIP is not the correct IP
to get the internal ip (not the localhost), is easy, but to get the ip that the outsider need to have to be able to connect to you is another thing.
I remember this issue when I worked on that 10+ years ago. Tomorrow when I get home I will dig up if I can find that function that gives u that IP.
of course, if both machines are "passive", there can not be a connection, one need to be "active" or u need a 3rd machine that acts like a tunnel between the two passive machines.
-
Oct 6th, 2020, 08:12 PM
#5
Re: Winsock LocalIP is not the correct IP
-
Oct 7th, 2020, 11:01 AM
#6
Re: Winsock LocalIP is not the correct IP
I did try the code and it doesn't work with windows 7. it seems the API calls will only work on the private IP, not external. I remember it worked on XP, could be something is changed or I was just lucky when I used it back in the day.
better try your luck with the link dilettante posted.
grab the IP from a site, theres numerous sites that offer your IP.
-
Oct 17th, 2020, 09:02 PM
#7
Thread Starter
Junior Member
Re: Winsock LocalIP is not the correct IP
Binding the right IP is the problem
-
Oct 18th, 2020, 03:00 AM
#8
Re: Winsock LocalIP is not the correct IP
Originally Posted by Tert
Binding the right IP is the problem
The problem is the link to the ZIP in your OP is very hard to notice! I'm posting a link to the original Planet Source Code submission you are having troubles with for the rest of the members to ponder on: A sample to transfer binary through winsock at very very high speed (Meet industrial standard)
Now, let's clear something about IP connections between two peers
There are *four* IP addresses involved here (not just two) like this
Code:
P1 | | P2
----- -----
IP-A1 | -----> | IP-A2
IP-B2 | <----- | IP-B1
Both P1 and P2 have *different* view on the connection between them, and P1 thinks the connection is between IP-A1 and IP-A2 while P2 thinks the connection is betwen IP-B1 and IP-B2
So which IP address do you need to know?
cheers,
</wqw>
p.s. Btw, posting executables in this forum is not allowed.
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
|