🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
7 messages
7 total messages Started by Marcin_g Sat, 28 Oct 2006 19:30
How to check my IP
#1793
Author: Marcin_g
Date: Sat, 28 Oct 2006 19:30
4 lines
889 bytes
Hi,
I write simple server (ServerSocket component in BCB6.0) application and I would like to check my IP address and/or internet connection accesibility. How to make this?
Please help.
Re: How to check my IP
#1794
Author: Hans Galema
Date: Sat, 28 Oct 2006 20:46
20 lines
1758 bytes
Marcin_g wrote:

> I write simple server (ServerSocket component in BCB6.0) application and I would like to check my IP address and/or internet connection accesibility. How to make this?

On the server computer start a browser and go to
http://whatismyip.com or http://checkip.dyndns.org
This will tell you your internet-ip.
Start your server listening on some port.

Now start a client on a machine somewhere on the internet
and let it connect to your internet-ip and the port your server
is listening on.

If there is a connection you are ready.

Otherwise - if you have a router- you first have to adjust your
router in such a way that it forwards request on
that specific port to your servercomputer on its intern-ip (or lan-ip).

Hans.
Re: How to check my IP
#1797
Author: Marcin Golas
Date: Sun, 29 Oct 2006 11:09
30 lines
2251 bytes
Thank you very much Hans, your solution is very good,  but I use Indy 
component: IdIPWatch. Its very simple. This component determines the online 
status and IP addresses for a computer. I know that, when computer is behind 
router IdIPWatch always returns C-class IP address (not global IP), but in 
my case I will always use global IP (DSL connection without router).

Uzytkownik "Hans Galema" <notused@notused.nl> napisal w wiadomosci 
news:4543c1e8@newsgroups.borland.com...
> Marcin_g wrote:
>
>> I write simple server (ServerSocket component in BCB6.0) application and 
>> I would like to check my IP address and/or internet connection 
>> accesibility. How to make this?
>
> On the server computer start a browser and go to
> http://whatismyip.com or http://checkip.dyndns.org
> This will tell you your internet-ip.
> Start your server listening on some port.
>
> Now start a client on a machine somewhere on the internet
> and let it connect to your internet-ip and the port your server
> is listening on.
>
> If there is a connection you are ready.
>
> Otherwise - if you have a router- you first have to adjust your
> router in such a way that it forwards request on
> that specific port to your servercomputer on its intern-ip (or lan-ip).
>
> Hans. 
Re: How to check my IP
#1802
Author: Remy Lebeau (TeamB)
Date: Sun, 29 Oct 2006 19:41
18 lines
1533 bytes
"Marcin Golas" <golasm@poczta.fm> wrote in message
news:45448c08@newsgroups.borland.com...

> I use Indy component: IdIPWatch. Its very simple.

A little too simple.  It only works in environment that have a single IP
address only.  It is not designed for multi-homed environments.

> This component determines the online status and IP addresses for a
computer.

Only when the computer is directly connected to the Internet.  It does not
work when the computer gets its Internet connection through a router or
gateway.


Gambit
Re: How to check my IP
#1803
Author: Marcin Go�a�
Date: Sun, 29 Oct 2006 20:49
24 lines
1732 bytes
Thanks Gambit for additional information...

U�ytkownik "Remy Lebeau (TeamB)" <no.spam@no.spam.com> napisa� w wiadomo�ci 
news:45450442@newsgroups.borland.com...
>
> "Marcin Golas" <golasm@poczta.fm> wrote in message
> news:45448c08@newsgroups.borland.com...
>
>> I use Indy component: IdIPWatch. Its very simple.
>
> A little too simple.  It only works in environment that have a single IP
> address only.  It is not designed for multi-homed environments.
>
>> This component determines the online status and IP addresses for a
> computer.
>
> Only when the computer is directly connected to the Internet.  It does not
> work when the computer gets its Internet connection through a router or
> gateway.
>
>
> Gambit
>
> 
Re. How to check my IP
#1812
Author: Elmar Baumann
Date: Mon, 30 Oct 2006 19:49
54 lines
2168 bytes
>Marcin_g wrote in Article <4543afc2$1@newsgroups.borland.com>
>with Subject: How to check my IP, on 28.10.2006 20:30:10
>
>
>
>Hi,
>I write simple server (ServerSocket component in BCB6.0) application and I would like to check my IP address and/or internet connection accesibility. How to make this?
>Please help.

hello,

i've wrote a small indy9-app (BCB6) for that:

download at http://home.arcor.de/elmar-baumann/tools/wanip.exe

it gets the IP via HTTP-Request on http://checkip.dyndns.org !


void __fastcall TForm1::GetIP()  //called by OnButtonClick
{
 int a,b;
 AnsiString line;

 try
 {
  line = IdHTTP1->Get("http://checkip.dyndns.org");
 }
 catch (Exception &exception)
 {
  MessageBox(0,exception.Message.c_str(),"Connection Error",MB_OK);
 }

 a = line.Pos("Current IP Address:");
 b = line.Pos("</body>");

 IP = line.SubString(a+19,b-(a+19));

 Edit1->Text = IP;
}


Regards

Elmar Baumann



------------------------------------------------------------------------------
Indy9 NNTP Internet News Reader/Writer, E. Baumann Software 2005
�Online on IRC, irc.p2p-network.net, #CodersPlanet�

Portions of this Software are Copyright (c) 1993 - 2005, 
Chad Z. Hower (Kudzu) and the Indy Pit Crew 
<http://www.IndyProject.org/>
Re: Re. How to check my IP
#1814
Author: Remy Lebeau (TeamB)
Date: Mon, 30 Oct 2006 22:51
11 lines
1197 bytes
"Elmar Baumann" <elmar-nospam@anywhere.net> wrote in message
news:4546576a@newsgroups.borland.com...

> it gets the IP via HTTP-Request on http://checkip.dyndns.org !

There are other services, such as http://iplookup.flashfxp.com, that return
the IP in text format without any extra HTML that you have to strip off.


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads