Connecting TServerSocket & TClientSocket over Internet ?

Posted on 2015-02-16
Last Modified: 2015-02-19
I can successfully connect TServerSocket & TClientSocket over LAN.
Similarly I check with and getting my current IP put it in the Client address and try to connect but it does not ?
Question by:Allan_Fernandes
  • 3
  • 2
  • 2
LVL 19

Expert Comment

ID: 40611954
You need to give more details. What is, where is the server located, are there routers, firewalls, etc?
LVL 24

Expert Comment

ID: 40612093
So many questions have been asked about this issue. But it is not Delphi or code related issue, it is a Network Configuration.

I see what you tried. Although you have got the external IP of your computer, you can not use it for the Server Socket to be connected to it from another computer directly over the internet. For a very basic reason, networks are not designed to work like that, security-wise. does not provide you enough information, check this one to get what I mean. What do you see under network is the ISP server network that blocks your IP from being connected to, from outside.

So, since you could not connect then, you have what is known as a non-routable IP address, which is the one that everyone gets when connecting to the internet via ISP. To be communicating through the ISP.

You need to approach your ISP and request a public IP address, if they allow it they will rent you one.

It depends on what you are trying to do here.
If you need something like TeamViewer then you need to have Server (public IP).
Alternative, for simple transmissions, you can use online Database or if you have a website hosted at any Server you can use TidHttp and with some php help you can communicate very easily through the Database.
LVL 24

Expert Comment

ID: 40612094
PS: Communications over the Internet are not fast.
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.


Author Comment

ID: 40613544
I have a backup software and it works well over LAN / MPLS. I have been approached by a customer who says in his country it is not easy to get a Static IP  therefore other applications like Antivirus etc use methods wherein a new IP is allocated each time the Server connects to the Web and all the clients are supposed to use that.
LVL 24

Expert Comment

ID: 40613590
Your customer wants to give the Server IP to other users (clients)?

Can you state clearly what you are after?
LVL 19

Accepted Solution

MerijnB earned 500 total points
ID: 40613685
it is not easy to get a Static IP  therefore other applications like Antivirus etc use methods wherein a new IP is allocated each time the Server connects to the Web and all the clients are supposed to use that

If I understand correctly this means that you need to get  a server with a static IP somewhere, where both your client software and your server software connect to. This means you need to change the architecture of both your client and your server software.

Alternatively you can look into services like this is probably the way of least resistance.

Once you have a static IP, or a dynamic DNS (like dynip) you need to configure the network configuration of your client.
I don't know where you are located, but I doubt you don't have your own public ip, I can image that your public ip isn't static. This is something you need to check though!

Author Comment

ID: 40618358
Thanks dynamic DNS services is exactly what I was looking for but did not know the terminology that my customer was talking about.

Clarification to jimyX,
What I meant is that my application's Client Modules (running on several machines within the LAN) connect to the Server Module (on a Predefined machine with static IP) , during Setup the Servers IP/Name is configured on each Machine. Thus building a simple Socket Connection.

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
delphi exception 7 64
Delphi cmd execution 6 60
Process Javascript errors with Delphi TWebBrowser 1 132
find a node in VST 2 68
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question