FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Remote IP
Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
Remote IP
Posted: Thu Feb 07, 2008 09:03 AM
SylRob wrote:Alex,

I'm really familiar with the socket function ! :-). This won't work if the client connection come from the internet over a Router you'll obtain the ROUTER IP !

Best Regards,

Sylvain


I have used sockets over routers before, and have never had an issue with only getting the router ip....

Below over vpn

D:\Dev>ipconfig

Windows IP Configuration

PPP adapter AST:

        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 172.21.129.146
        Subnet Mask . . . . . . . . . . . : 255.255.255.255
        Default Gateway . . . . . . . . . :

D:\Dev>tracert -d 172.21.141.190

Tracing route to 172.21.141.190 over a maximum of 30 hops

  1   394 ms   307 ms   373 ms  172.21.129.128
  2     *      276 ms   544 ms  172.21.128.2
  3   687 ms   841 ms   467 ms  172.21.135.6
  4   588 ms   294 ms   752 ms  172.21.141.190

Trace complete.

D:\Dev>telnet 172.21.141.190 4040

Welcome listener from 172.21.129.146
Posts: 15
Joined: Thu Nov 01, 2007 04:54 PM
Remote IP
Posted: Wed Feb 13, 2008 10:46 AM

Alex,

The problem wasn't getting my OWN IP, the problem is getting the IP from a client connected to a TCP/IP server that I wrote when the server is behind a ROUTER !

Best Regards,

Sylvain

Sylvain Robert
Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
IP
Posted: Wed Feb 13, 2008 10:51 AM

So you want to get the IP Address from Client A, connected to server B, while you are at client C, connecting to B?

Can't server B keep a record of who's connected?

Posts: 15
Joined: Thu Nov 01, 2007 04:54 PM
Remote IP
Posted: Wed Feb 13, 2008 11:19 AM

simpler than that, I just want the IP adress of the client that his connected to the current socket descriptor of my TCP/IP server when behind a ROUTER.

Best,

Sylvain

Sylvain Robert
Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
Remote IP
Posted: Wed Feb 13, 2008 01:12 PM

Well, isn't that what oSocket:clientip() gives on the server? It does for me...

Posts: 15
Joined: Thu Nov 01, 2007 04:54 PM
Remote IP
Posted: Wed Feb 13, 2008 01:15 PM

Alex,

It won't if your server is behind the ROUTER and the client connect to your server from the WAN you'll receive the ROUTER IP not the client IP

Best,

Sylvain

Sylvain Robert

Continue the discussion