🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #4587

Re: GStack->WSGetHostByAddr(sIP)) on Win2000

#4587
From: James
Date: Sat, 15 Jan 2005 13:57
34 lines
2022 bytes
That should be:

  sIP = AThread->Connection->Socket->Binding->PeerIP;

D'oh! Sorry!

- JamesB


"James" <jb9@btinternet.com> wrote in message 
news:41e920eb$1@newsgroups.borland.com...
> Hello!
>
> I'm using Indy9 and BCB6 Enterprise, and I'm trying to get the name of the 
> computer that's connected. In the OnConnect event of TIdTCPServer, I've 
> the following code:
>
>  sIP = pAThread->Connection->Socket->Binding->PeerIP;
>  sCompName = GStack->WSGetHostByAddr(sIP);
>
> This works fine on all the machines I've tried it on - except a Windows 
> 2000 computer, where an exception is thrown during WSGetHostByAddr(). Has 
> anyone any idea about what would cause this call to fail, and what I can 
> do about it?
>
> I've checked the sIP variable, and it is correct; but WSGetHostByAddr() 
> still fails.
>
> Thanks,
>
> - James
>
>
> 
Technical Details
Message-ID: <41e92164@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out2.kabelfoon.nl!83.128.0.10.MISMATCH!newsfeed.kabelfoon.nl!213.218.66.70.MISMATCH!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41e920eb$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,d9fc8064c62c70f0,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "James" <jb9@btinternet.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <41e920eb$1@newsgroups.borland.com>
Subject: Re: GStack->WSGetHostByAddr(sIP)) on Win2000
Date: Sat, 15 Jan 2005 13:57:56 -0000
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
NNTP-Posting-Host: 217.42.177.103
Message-ID: <41e92164@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1105797476 217.42.177.103 (15 Jan 2005 05:57:56 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out2.kabelfoon.nl!83.128.0.10.MISMATCH!newsfeed.kabelfoon.nl!213.218.66.70.MISMATCH!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail