Article View: borland.public.cppbuilder.nativeapi
Article #2025Re: TClientSocket::LocalAddress
From: Robert G. Hoover
Date: Fri, 11 May 2007 11:26
Date: Fri, 11 May 2007 11:26
55 lines
3204 bytes
3204 bytes
Hi Remy, Great stuff!!! (as usual) Well, it seems that I am not connecting to whom I should be. I am getting a partial response from someone, whom I must assume is the company SMTP server (not on my computer). I get the standard communication stuff. "250 Ok." So I must be talking to the right computer with the right protocol. Yet, my Socket->LocalAddress = 127.0.0.1. It sure doesn't sound right. I've got a few other programs running.... Skype, VNC Server, AVAST AntiVirus. I'm going to knock them down 1 by 1 to see which one might be causing the communication breakdown. Thanks for the help! The iplookup addy will come in handy! Rob Remy Lebeau (TeamB) wrote: > "Robert G. Hoover" <not.a.real.address@anywhere.sorry> wrote in > message news:46434854$1@newsgroups.borland.com... > >> I'm identifying myself to the server as Socket->LocalHost >> >> ehlo [192.168.0.109] >> >> which seems to work on my laptop where LocalAddress = 192.168.0.109 >> and does not work on my desktop where LocalAddress = 127.0.0.1. > > The LocalAddress can only be 127.0.0.1 if you had connected to > "localhost" when connecting the socket. Is your server running on the > same desktop machine as your client program? > >> Neither of these is ideal as I think the SMTP server wants my >> "worldview" IP address which is something like 109.76.35.22. > > Actually, you should be sending your machine name, not your IP > address. > >> How can I determine my actual IP address from inside this > TClientSocket object? > > If you are directly connected to the Internet, such that your modem is > physically plugged into your machine, then you can use > GetAdaptersInfo() to get the IP address from the desired NIC, which > should be the same IP that LocalAddress returns. But if you are > getting your Internet access through a router or gateway, then you > will have to query an external source, such as > http://iplookup.flashfxp.com or similar site, to get your public IP > address. > > > Gambit > >
Technical Details
Message-ID:
<46445305$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!newsfeed0.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<46434854$1@newsgroups.borland.com> <46435e8d$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a04762d1675e9ed3 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Fri, 11 May 2007 07:26:59 -0400 From: "Robert G. Hoover" <not.a.real.address@anywhere.sorry> User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: TClientSocket::LocalAddress References: <46434854$1@newsgroups.borland.com> <46435e8d$1@newsgroups.borland.com> In-Reply-To: <46435e8d$1@newsgroups.borland.com> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000739-2, 05/11/2007), Outbound message X-Antivirus-Status: Not-Tested NNTP-Posting-Host: 76.106.54.160 Message-ID: <46445305$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1178882821 76.106.54.160 (11 May 2007 04:27:01 -0700) Lines: 55 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!newsfeed0.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail