Socket Error #11001

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
andy_bri
Posts: 19
Joined: Fri 02 Oct 2009 12:36

Socket Error #11001

Post by andy_bri » Thu 21 Apr 2022 13:02

For last weeks our customers notify us a problem with connecting to the local Firebird database, when computer has no internet access.

Database: Firebird 2.5.9 and Firebird 3.0.x, located on local machine
Unidac: the newest version, but also in previous realease.
Delphi 11, Enterprise.
When the user tries to connect database, he receives the error: Socket Error #11001 or "Could not locate host machine".
When internet is on, there are no problems with connection.

I tried to reproduce on my machine, but everything works ok here.
Maybe I have changed something in connection settings, but I cannot find any differences.
Could it be connected to the last Delphi release (11) or Windows update?
For many years we haven't got this error.

Thanks in advance!

frickler
Posts: 37
Joined: Wed 04 Apr 2018 08:30

Re: Socket Error #11001

Post by frickler » Fri 22 Apr 2022 10:19

Is it possible, that "no internet access" really means "no access to router" which includes no access to DNS?

andy_bri
Posts: 19
Joined: Fri 02 Oct 2009 12:36

Re: Socket Error #11001

Post by andy_bri » Fri 22 Apr 2022 10:26

It is possible. But is DNS configuration required to connect, when the database and the program are on the same machine?

pavelpd
Devart Team
Posts: 109
Joined: Thu 06 Jan 2022 14:16

Re: Socket Error #11001

Post by pavelpd » Tue 10 May 2022 14:07

Hi Andy!

In order to eliminate the error with DNS, you can try to specify an explicit IP address of the machine on which the database server is located.

If the database server and the program are on the same machine, also specify the IP address of the machine and inform us of the results.

margotcantrell
Posts: 1
Joined: Wed 11 May 2022 09:18

Re: Socket Error #11001

Post by margotcantrell » Wed 11 May 2022 09:24

pavelpd wrote: Tue 10 May 2022 14:07 Hi Andy!

In order to eliminate the error with DNS, you can try to specify an explicit IP address of the machine on which the database server is located.

If the database server and the program are on the same machine, also specify the IP address of the machine and inform us of the results.
Hi Andy
You can do as Pavelpd instructs. I tried again and the error was fixed. dinosaur game

andy_bri
Posts: 19
Joined: Fri 02 Oct 2009 12:36

Re: Socket Error #11001

Post by andy_bri » Wed 11 May 2022 14:13

Thank you all for replies and advices.

Finally I discovered the problem. It was not connected to Unidac components at all.
Just after connection I need to read real time.
I check, if the internet is available:

function IsInternetConnection: Boolean;
var
Flags: DWORD;
begin
Flags := INTERNET_CONNECTION_MODEM or INTERNET_CONNECTION_LAN or
INTERNET_RAS_INSTALLED or INTERNET_CONNECTION_PROXY or INTERNET_CONNECTION_MODEM_BUSY;
Result := InternetGetConnectedState(@Flags, 0); // Test connection
end;

If the connection is available, I read current time from the SNTP server.
However sometimes the function IsInternetConnection returns True even if the internet is off.
Then I try to call Sntp Server and I receive Socket Error!

Sorry for bothering you and thanks for all the answers!

pavelpd
Devart Team
Posts: 109
Joined: Thu 06 Jan 2022 14:16

Re: Socket Error #11001

Post by pavelpd » Thu 19 May 2022 08:42

Hi!

We are glad to see that you have found the reasons of the Socket Error #11001.
Please feel free to contact us if you have any further questions regarding our products.

Post Reply