Page 1 of 1
ping connection take long time
Posted: Wed 12 Nov 2014 11:01
by necmetdin
i am having some problems with a app i am writing for android
I use ping to check if connection is valid
code below:
try{
MyConnection1->Ping();
ShowMessage("ping succes");
.....
.....
}
catch(...)
{
ShowMessage("ping CRASHH");
}
when i run code and component is connected there is no problem.
but then i shutdown the mysql server.
then i run the code. it takes 1 minute before it detects there is no connection.
is this the right way to check for mysql connection? if yes, please tell me why it takes long.
i use embarcadero XE6. cpp
MyDac 8.3.9
Re: ping connection take long time
Posted: Fri 14 Nov 2014 09:27
by ViktorV
You are using the TMyConnection->Ping method correctly for checking the MySQL server connection status. Unfortunately, we couldn't reproduce the problem. When trying to reproduce, the TMyConnection->Ping method returns the result with no delay. This issue may be due to your system configuration.
Re: ping connection take long time
Posted: Fri 14 Nov 2014 09:34
by necmetdin
Rhank you for answering my post.
but can you tell me where to look?
is it in my mysql configuration? or somewhhere else?
Re: ping connection take long time
Posted: Fri 14 Nov 2014 10:22
by necmetdin
foir testing purpose i create windows application.
here i see directly (2 - 3 seconds) that mysql is not available.
so it is only on android where it takes a long time
Re: ping connection take long time
Posted: Fri 14 Nov 2014 10:43
by ViktorV
Please try to decrease the value of the TMyConnection->ConnectionTimeout property (for example, to 3) and check if the problem still persists.
Re: ping connection take long time
Posted: Fri 14 Nov 2014 10:59
by necmetdin
Oke, i tried 0, 1, 3. default is 15. still takes long time
Re: ping connection take long time
Posted: Mon 17 Nov 2014 09:01
by ViktorV
Replace your code with the following and check whether the delay occurs on an attempt to establish a connection (MyConnection1->Connect()) or when calling the MyConnection1->Ping() method:
Code: Select all
MyConnection1->Connect();
try{
MyConnection1->Ping();
ShowMessage("ping succes");
}
catch(...)
{
ShowMessage("ping CRASHH");
}
Re: ping connection take long time
Posted: Tue 18 Nov 2014 09:12
by necmetdin
i start app with mysql donw state
connect() function takes long. it takes 1 minute before i get error.
then i restart app with mysql online.
it takes 2 a 3 seconds to connect.
next thing i put mysql down.
this time ping() function takes long. (1 minute)
connect funtion takes less then 1 second.
Re: ping connection take long time
Posted: Thu 20 Nov 2014 12:37
by necmetdin
Please can someone help me futher with this issue
Re: ping connection take long time
Posted: Fri 30 Jan 2015 10:52
by ViktorV
Please update MyDAC to the latest (8.4.13) version and check if the problem is reproduced on the new version.