aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMMCPConnection.h
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-02-25 01:03:29 +0000
committerrowanbeentje <rowan@beent.je>2009-02-25 01:03:29 +0000
commit10a7c5a32983070158a736e479b2c6200ecd70fd (patch)
treebc8c6b5a30886449707b5464bacdc570bfa0e775 /Source/CMMCPConnection.h
parent27285b94decd7e3ce6e6600ee074e92bd0449f7d (diff)
downloadsequelpro-10a7c5a32983070158a736e479b2c6200ecd70fd.tar.gz
sequelpro-10a7c5a32983070158a736e479b2c6200ecd70fd.tar.bz2
sequelpro-10a7c5a32983070158a736e479b2c6200ecd70fd.zip
Implement a connection keepalive, addressing Issue #171. This runs a ping every sixty seconds (a value stored in prefs, though not exposed via the prefs interface yet) in a background thread, to further improve connectivity handling following r334. Pings are only run when necessary - ie active use of the program extends the next ping interval as appropriate, so general impact should be minimal.
Diffstat (limited to 'Source/CMMCPConnection.h')
-rw-r--r--Source/CMMCPConnection.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/CMMCPConnection.h b/Source/CMMCPConnection.h
index 3a6b4016..a9b2554e 100644
--- a/Source/CMMCPConnection.h
+++ b/Source/CMMCPConnection.h
@@ -49,6 +49,9 @@
NSString *connectionHost;
int connectionPort;
NSString *connectionSocket;
+
+ NSTimer *keepAliveTimer;
+ NSDate *lastKeepAliveSuccess;
}
- (id) init;
@@ -65,5 +68,9 @@
- (void) setDelegate:(id)object;
- (NSTimeZone *) timeZone;
- (BOOL) pingConnection;
+- (void) startKeepAliveTimerResettingState:(BOOL)resetState;
+- (void) stopKeepAliveTimer;
+- (void) keepAlive:(NSTimer *)theTimer;
+- (void) threadedKeepAlive;
@end