Page 1 of 1

MyConnection->Connect()........ hang until connected...

Posted: Fri 27 Jan 2006 11:25
by Rocojo
I've a problem.

I am building an DLL (with borland c++ builder 6) witch contains a MyConnection, MyQuery and a MyTable.

Everithing is working fine but there is only one big problem....

when i try to connect with a mysql server in a network my whole program hangs and waits until the connection is established..... I want to keep the program running.... Can i put this (MyConnection->Connect()) into a thread? How can i do this......... i tried this already but the program is still hanging until connected...

Could somebody help me.

Posted: Tue 31 Jan 2006 07:41
by Ikar
MySQL API doesn't allow asynchronous connection. Your apllication should create additional thread to establish connection and watch it so that other threads don't try to perform requests through the MyConnection.

Posted: Tue 31 Jan 2006 15:17
by Rocojo
thank you for your reaction, we are trying to put everything into Threads... but the problem is that we have several functions to execute in the dll....

so its not easy...

Posted: Wed 01 Feb 2006 10:00
by Rocojo
I solved the problem.. i put the myconnection->connect() into a thread and now its perfetc. i am going to implement a callback function so the software nows when i om ready to receive or send...

very goor