diff options
author | Mark Spruiell <mes@zeroc.com> | 2017-01-30 13:45:21 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2017-01-30 13:45:21 -0800 |
commit | 61270a10f980933cf582edb766f10c8ac6d86e8a (patch) | |
tree | 45ab4a7c2986954054fce613bc3c8f7967e7951e /objective-c/src | |
parent | Fix slice2cpp build failure (diff) | |
download | ice-61270a10f980933cf582edb766f10c8ac6d86e8a.tar.bz2 ice-61270a10f980933cf582edb766f10c8ac6d86e8a.tar.xz ice-61270a10f980933cf582edb766f10c8ac6d86e8a.zip |
merging IceBridge into master
Diffstat (limited to 'objective-c/src')
-rw-r--r-- | objective-c/src/Ice/ConnectionI.mm | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/objective-c/src/Ice/ConnectionI.mm b/objective-c/src/Ice/ConnectionI.mm index 3b0d642b934..6de819d2433 100644 --- a/objective-c/src/Ice/ConnectionI.mm +++ b/objective-c/src/Ice/ConnectionI.mm @@ -266,12 +266,12 @@ private: } @implementation ICEConnection --(void) close:(BOOL)force +-(void) close:(ICEConnectionClose)mode { NSException* nsex = nil; try { - CONNECTION->close(force); + CONNECTION->close((Ice::ConnectionClose)mode); } catch(const std::exception& ex) { @@ -379,6 +379,52 @@ private: { CONNECTION->setHeartbeatCallback(new HeartbeatCallbackI(self, callback)); } +-(void) heartbeat +{ + NSException* nsex = nil; + try + { + CONNECTION->heartbeat(); + } + catch(const std::exception& ex) + { + nsex = toObjCException(ex); + } + if(nsex != nil) + { + @throw nsex; + } +} +-(id<ICEAsyncResult>) begin_heartbeat +{ + return beginCppCall(^(Ice::AsyncResultPtr& result) + { + result = CONNECTION->begin_heartbeat(); + }); +} +-(id<ICEAsyncResult>) begin_heartbeat:(void(^)(ICEException*))exception +{ + return [self begin_heartbeat:exception sent:nil]; +} +-(id<ICEAsyncResult>) begin_heartbeat:(void(^)(ICEException*))exception sent:(void(^)(BOOL))sent +{ + return beginCppCall(^(Ice::AsyncResultPtr& result, const Ice::CallbackPtr& cb) + { + result = CONNECTION->begin_heartbeat(cb); + }, + ^(const Ice::AsyncResultPtr& result) + { + CONNECTION->end_heartbeat(result); + }, + exception, sent); +} +-(void) end_heartbeat:(id<ICEAsyncResult>)result +{ + endCppCall(^(const Ice::AsyncResultPtr& r) + { + CONNECTION->end_heartbeat(r); + }, result); +} -(void) setACM:(id)timeout close:(id)close heartbeat:(id)heartbeat { IceUtil::Optional<int> to; |