Page 1 of 1

About TUniConnection ConnectionTimeout ?? WHY ??

Posted: Sat 04 Feb 2012 05:28
by zhbj
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]

Posted: Mon 06 Feb 2012 11:50
by AndreyZ
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.

Posted: Mon 06 Feb 2012 14:14
by zhbj
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!!

Posted: Mon 06 Feb 2012 17:13
by AndreyZ
Such behavior is caused by the specificity of network work. The ways of resolving server name are different for DNS names and IP addresses.