ping connection take long time
ping connection take long time
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
			
									
									
						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
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
Rhank you for answering my post.
but can you tell me where to look?
is it in my mysql configuration? or somewhhere else?
			
									
									
						but can you tell me where to look?
is it in my mysql configuration? or somewhhere else?
Re: ping connection take long time
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
			
									
									
						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
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
Oke, i tried 0, 1, 3. default is 15. still takes long time
			
									
									
						Re: ping connection take long time
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
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.
			
									
									
						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
Please can someone help me futher with this issue
			
									
									
						Re: ping connection take long time
Please update MyDAC to the latest (8.4.13) version and check if the problem is reproduced on the new version.