About TUniConnection ConnectionTimeout ?? WHY ??

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
zhbj
Posts: 11
Joined: Wed 10 Nov 2010 07:24

About TUniConnection ConnectionTimeout ?? WHY ??

Post by zhbj » Sat 04 Feb 2012 05:28

Hello, uses unidac(3.6) to access sql server 2005 (192.168.1.3), the following code:

Code: Select all

  con.Close ;
  con.SpecificOptions.Clear;
  con.SpecificOptions.Values['ConnectionTimeout']:='5';//+2
  st := GetTickCount;
  con.ProviderName:='SQL Server';
  con.Database:=jy_database.Text ; // 'jgxt';
  con.Server:=jy_server_txt.Text ;
  con.Username:=jy_user_txt.Text ;
  con.Password:=jy_pass_txt.Text ;

    try
      con.open ;             
      st := GetTickCount - st;
    except 
      st := GetTickCount - st;   
    end;  
  showmessage(inttostr(st)) ;
If the server is using invalid host name, such as (localerr), prompt time-out in over 7000.

But if you are using an invalid ip address such as 192.168.1.44, timeout prompted more than 52000, why?

Long time-consuming, and can not accept, please help, thank you!

[/size]

AndreyZ

Post by AndreyZ » Mon 06 Feb 2012 11:50

Hello,

To connect to SQL Server, UniDAC uses OLE DB or SQL Native Client providers. The behaviour you encountered is a specificity of their work, we cannot influence it. You can check it using the standard ADO components.

zhbj
Posts: 11
Joined: Wed 10 Nov 2010 07:24

Post by zhbj » Mon 06 Feb 2012 14:14

AndreyZ wrote:Hello,

To connect to SQL Server, UniDAC uses OLE DB or SQL Native Client providers. The behaviour you encountered is a specificity of their work, we cannot influence it. You can check it using the standard ADO components.
Thank the reply,
But why access to the incorrect server name, or to access the incorrect server IP addresses, The timeout results of such a large difference ?

thanks!!

AndreyZ

Post by AndreyZ » Mon 06 Feb 2012 17:13

Such behavior is caused by the specificity of network work. The ways of resolving server name are different for DNS names and IP addresses.

Post Reply