Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6229213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:31:40+00:00 2026-05-24T09:31:40+00:00

How to determine the IdTcpServer’s ‘internet’ ip and port using delphi? Not the local

  • 0

How to determine the IdTcpServer’s ‘internet’ ip and port using delphi? Not the local (127.0.0.1 or 192.168.0.1) but the public internet ones.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:31:41+00:00Added an answer on May 24, 2026 at 9:31 am

    Ports and Bindings

    The port number is easily determined, if you care to inspect TIdTcpServer, you’ll notice it has a DefaultPort property, and Bindings and so if you are asking what port it is “accepting connections on”, it should be the DefaultPort, or whatever is configured inside Bindings. Once you have a session active, that session will be active on its own port number which is dynamically assigned.
    If in my app, I set the IdTcpServer1.DefaultPort to 90, and then dump the contents of the bindings at runtime I get this list:

    0.0.0.0:90
    0:0:0:0:0:0:0:0:90
    

    The above list showing all zeroes is IP-address-wildcard notation, telling me that I’m listening on all available local IPV4 and IPV6 addresses, at port 90. The code I used to dump the above list is:

    procedure DumpBindings;
    var
     n:Integer;
    begin
       for n := 0 to IdTCPServer1.Bindings.Count-1 do begin
         with IdTCPServer1.Bindings[n] do begin
            Memo1.Lines.Add( ip+':'+IntToStr(Port) );
         end;
       end;
    end;
    

    Public Ip Addresses

    So lets go back to IP addresses only, and ignore ports, for the rest of this question:

    Your computer probably has an ethernet card, or a wireless network adaptor, or both, and either of both of those, could each have their own private address. Secondly, any network adapter in your computer could also have a public IP if you are the network administrator and you’ve given it one. If you did not configure the network you are using, chances are very slim that you’re using a publically accessible IP at all on your machine.

    Your question would be better if you first looked here which tells you how to determine what IPs your computer is accessible as (enumerate all local IPs). Then you could ask a question about filtering that list, and finding the correct one by discarding private non-routable addresses. Except that I bet it won’t work in your case… Let’s figure out why…

    If you are an average home or business desktop PC user, who is using a private-IP address on your PC, and your internet connection happens via Network Address Translation (NAT), then the answer is that your PC doesn’t even have a public address.

    It is possible to configure a NAT based router to forward ports, but I am unaware of any way for the recipient of that forwarding to be aware of the existence of a port forward to your machine. If you need help configuring your NAT based DSL or cable modem at home to forward a port to your Delphi application, that would be a better question to ask somewhere else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to determine which application or system program is using a particular port
I am trying to determine if a phone is located in this polygon using
I'm trying to determine the iPhone user's location using a CLLocationManager and CLGeocoder. My
I am trying to determine whether a ring is contained by another ring using
I know how to determine which DOM nodes intersect an absolute position. But say
How can I determine if an input string only contains spaces, using javascript?
I'm trying to determine what the best standard is for using helpers in views
How do I determine the (local-) path for the Program Files directory on a
To determine the ratio at which to scale an image, I'm using the following
How to determine what are the tables locked using mysql?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.