Slow connection by local IP
Posted: Fri 03 Nov 2017 11:39
We are using Mobile edition to connect from Windows CE/Windows Mobile devices to Postgresql server. After update to version 7.10 (actualy all version above 7.4) we have very slo connection time to Linux servers in local network. When connecting to server by public IP connection is fast.
Example - this connection take about 10-12 seconds
Example - this connection take about 1 second
After some investigating I suspect that You changed connection method:
This takes couple of seconds:
IPHostEntry entry = Dns.GetHostEntry("192.168.0.3");
But this - which I supose was used before - takes about 0 secons
IPAddress[] entry = Dns.GetHostAddresses("192.168.0.3");
Is it possible that You changed connection method? Is there a workaround? Or could You provide us some source code that we can change? We bought new version of dotConnect so we can update our server to Postgresql 9.6 - but w still can't.
Version 7.3 connect fine always, but it's not compatible with Pg9.6.
Example - this connection take about 10-12 seconds
Code: Select all
PgSqlConnectionStringBuilder csb = new PgSqlConnectionStringBuilder();
csb.Host = "192.168.0.3";
csb.Port = 5432;
csb.UserId = "****";
csb.Password = "*****";
csb.Database = "****";
csb.ConnectionTimeout = 30;
PgSqlConnection connection = new PgSqlConnection(csb.ConnectionString);
connection.Open();
Code: Select all
PgSqlConnectionStringBuilder csb = new PgSqlConnectionStringBuilder();
csb.Host = "91.201.154.162";
csb.Port = 5433;
csb.UserId = "****";
csb.Password = "*****";
csb.Database = "****";
csb.ConnectionTimeout = 30;
PgSqlConnection connection = new PgSqlConnection(csb.ConnectionString);
connection.Open();
This takes couple of seconds:
IPHostEntry entry = Dns.GetHostEntry("192.168.0.3");
But this - which I supose was used before - takes about 0 secons
IPAddress[] entry = Dns.GetHostAddresses("192.168.0.3");
Is it possible that You changed connection method? Is there a workaround? Or could You provide us some source code that we can change? We bought new version of dotConnect so we can update our server to Postgresql 9.6 - but w still can't.
Version 7.3 connect fine always, but it's not compatible with Pg9.6.