lp / ObjCHiredis

Hiredis with Objective-C Interface
162 stars 22 forks source link

Crash with bad memory access using command #6

Open coov opened 11 years ago

coov commented 11 years ago

Hi,

I am using ObjCHiredis in a Mac objective C program to access a database hosted on a website. If the connection to the site goes down, the following call fails with an null memory access:

rand_key = [mRedisDB command:@"RANDOMKEY"];

Looking at the header, I don't see a checkConnection type of function. And if the connection fails, this call definitely doesn't fail gracefully. The header shows the following options:

Is there anything that I am missing to avoid making this call without an internet connection? Although I am checking for the connection in my program before making the call, it still will fail if the connection goes down between the check and the above call.

Thanks,

Coov