Postgresql connection problem

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 78
Joined: Sat 01 Jul 2006 11:42

Postgresql connection problem

Post by chkaufmann » Mon 06 May 2019 05:48


one of my customers reports an application error that I cannot reproduce anywhere else.

Code: Select all

thread $8590 (TBSDBMessageController), inner exception level 3:
>> SocketException, Cannot connect to server on host 'srsofaioi23358': Only one usage of each socket address is normally permitted. Socket Error Code: 10048($2740)
01c35417 Logo12.exe   CRVioTcp                568 TCRVioTcp.Connect
01f68a6d Logo12.exe   PgSQLProtocolUni       1218 TPgSQLProtocol.CreateVio
01f692d6 Logo12.exe   PgSQLProtocolUni       1445 TPgSQLProtocol.StartConnection
01f67c7c Logo12.exe   PgSQLProtocolUni        758 TPgSQLProtocol.Connect
01f8a462 Logo12.exe   PgClassesUni           4166 InternalConnect
01f8a548 Logo12.exe   PgClassesUni           4191 TPgSQLConnection.Connect
01c11d30 Logo12.exe   DBAccess               4187 TCustomDAConnection.DoConnect
01c6fd03 Logo12.exe   Uni                    1858 TUniConnection.DoConnect
01c120cd Logo12.exe   DBAccess               4308 TCustomDAConnection.PerformConnect
01c15105 Logo12.exe   DBAccess               5370 TCustomDAConnection.SetConnected
007d34f0 Logo12.exe   Data.DB                     TCustomConnection.Open
01d8828e Logo12.exe   BSDBUniDACImp           501 TBSUniConnection.InternalOpen
The code is running in a background thread that starts every two seconds. Normally I keep the connection open between two calls but every 100 seconds I force to close the connection and then reopen it again.

The same application runs for other customers during many days without any problem, so I think, it has something to do with this customers setup of the network or his Postgresql server.

But since the error message apears in my application, I have to "prove" that this is the case and I didn't find the source for the problem yet.

Any hints where to search? Or what I can change on my test Postgresql server so that I get this error as well?


Devart Team
Posts: 1477
Joined: Mon 06 Jul 2015 11:34

Re: Postgresql connection problem

Post by MaximG » Wed 08 May 2019 13:42

We cannot make any recommendation without a clear understaning of what’s going on with the project code before the error occurs. The described behavior is not caused by our components. You may want to search online for possible reasons for the error "Socket Error Code: 10048".

Post Reply