aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-03-26 01:36:54 +0000
committerrowanbeentje <rowan@beent.je>2010-03-26 01:36:54 +0000
commit6fb53eb4a62184f5ed0d8bdf42ff0973dd552ff9 (patch)
tree3d00b5e7717c555ed9bcca37cd81f42295eac75b /Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h
parentc90f1d608befc270de0a53711d1a6799da1ac03a (diff)
downloadsequelpro-6fb53eb4a62184f5ed0d8bdf42ff0973dd552ff9.tar.gz
sequelpro-6fb53eb4a62184f5ed0d8bdf42ff0973dd552ff9.tar.bz2
sequelpro-6fb53eb4a62184f5ed0d8bdf42ff0973dd552ff9.zip
- Simplify connection keepalives, moving to a single repeating timer on the main thread. This cleans up calls, results in small speed improvements when making lots of queries (no more stopping/starting of keepalives), and ensures only the main thread handles the initial keepalives.
- Move connection unlocking to a blocking call to fix http://log.sequelpro.com/view/73 - Fix memory leaks caused by non-detached pthreads
Diffstat (limited to 'Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h')
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h
index af38e99c..c6d81bd6 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h
@@ -112,6 +112,7 @@ static inline NSData* NSStringDataUsingLossyEncoding(NSString* self, NSInteger e
NSArray *allKeysofDbStructure;
NSTimer *keepAliveTimer;
+ double lastKeepAliveTime;
pthread_t keepAliveThread;
pthread_t pingThread;
uint64_t connectionStartTime;
@@ -127,15 +128,11 @@ static inline NSData* NSStringDataUsingLossyEncoding(NSString* self, NSInteger e
// Pointers
IMP cStringPtr;
IMP willQueryStringPtr;
- IMP stopKeepAliveTimerPtr;
- IMP startKeepAliveTimerPtr;
IMP timeConnectedPtr;
// Selectors
SEL cStringSEL;
SEL willQueryStringSEL;
- SEL stopKeepAliveTimerSEL;
- SEL startKeepAliveTimerSEL;
SEL timeConnectedSEL;
}
@@ -173,8 +170,6 @@ static inline NSData* NSStringDataUsingLossyEncoding(NSString* self, NSInteger e
- (BOOL)checkConnection;
- (BOOL)pingConnection;
void pingConnectionTask(void *ptr);
-- (void)startKeepAliveTimer;
-- (void)stopKeepAliveTimer;
- (void)keepAlive:(NSTimer *)theTimer;
- (void)threadedKeepAlive;
void performThreadedKeepAlive(void *ptr);