List:MySQL++« Previous MessageNext Message »
From:Adam Zerlin Date:November 16 2005 3:23am
Subject:Re: libmysql.dll crashes when losing internet connection
View as plain text  
I hit enter too soon.

I removed code within the {} in that last if else. But the code is not mySQL
code.

Am I understanding mysql_ping properly in that it will reconnect before it
returns its value of 0 or -1? Or will it return its value but start a
reconnection process in its own thread?

I may be going about this all wrong, and if so, please excuse my stupidity.
:)

Adam

On 11/15/05, Adam Zerlin <srfdriver22@stripped> wrote:
>
> In my application, I have queries being executed on 15 second intervals,
> using mysql_ping prior to sending the queries to make sure I'm still
> connected (using a persistant connection). However, if I unplug my cat5 to
> simulate losing my internet connection while the application is running,
> instead of skipping the query gracefully, Windows reports that
> libmysql.dll has crashed.
>
> This area of code looks something like this:
>
> if(connection == NULL)
> return false;
>
> if(mysql_ping(connection) != 0)
> return false;
>
> if(mysql_query(connection,query) != 0) { // query failed
>
> } else { // execute the query
>
> }
>
> --
>
> Adam
>



--

Adam

Thread
libmysql.dll crashes when losing internet connectionAdam Zerlin16 Nov
  • Re: libmysql.dll crashes when losing internet connectionAdam Zerlin16 Nov
  • Re: libmysql.dll crashes when losing internet connectionWarren Young16 Nov
    • Re: libmysql.dll crashes when losing internet connectionAdam Zerlin16 Nov