diff options
author | Benoit Foucher <benoit@zeroc.com> | 2018-02-09 18:21:07 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2018-02-09 18:46:33 +0100 |
commit | 635f5c751237535b1e3e435d8330fcaa39a47f82 (patch) | |
tree | a7f04aa70e16f84c15c28730310ac4f8e8187a80 /php/src/php5 | |
parent | ICE-8648 - Make IceBridge usable as router-for-OA (diff) | |
download | ice-635f5c751237535b1e3e435d8330fcaa39a47f82.tar.bz2 ice-635f5c751237535b1e3e435d8330fcaa39a47f82.tar.xz ice-635f5c751237535b1e3e435d8330fcaa39a47f82.zip |
Fixed shutdown/isShutdown/waitForShutdown to no longer throw if communicator is destroyed (ICE-8659)
Diffstat (limited to 'php/src/php5')
-rw-r--r-- | php/src/php5/Communicator.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/php/src/php5/Communicator.cpp b/php/src/php5/Communicator.cpp index bc12e0b8dd8..af32e26d476 100644 --- a/php/src/php5/Communicator.cpp +++ b/php/src/php5/Communicator.cpp @@ -265,6 +265,52 @@ ZEND_METHOD(Ice_Communicator, __construct) runtimeError("communicators cannot be instantiated directly" TSRMLS_CC); } +ZEND_METHOD(Ice_Communicator, shutdown) +{ + CommunicatorInfoIPtr _this = Wrapper<CommunicatorInfoIPtr>::value(getThis() TSRMLS_CC); + assert(_this); + + try + { + _this->getCommunicator()->shutdown(); + } + catch(const IceUtil::Exception& ex) + { + throwException(ex TSRMLS_CC); + } +} + +ZEND_METHOD(Ice_Communicator, isShutdown) +{ + CommunicatorInfoIPtr _this = Wrapper<CommunicatorInfoIPtr>::value(getThis() TSRMLS_CC); + assert(_this); + + try + { + RETURN_BOOL(_this->getCommunicator()->isShutdown() ? 1 : 0); + } + catch(const IceUtil::Exception& ex) + { + throwException(ex TSRMLS_CC); + RETURN_FALSE; + } +} + +ZEND_METHOD(Ice_Communicator, waitForShutdown) +{ + CommunicatorInfoIPtr _this = Wrapper<CommunicatorInfoIPtr>::value(getThis() TSRMLS_CC); + assert(_this); + + try + { + _this->getCommunicator()->waitForShutdown(); + } + catch(const IceUtil::Exception& ex) + { + throwException(ex TSRMLS_CC); + } +} + ZEND_METHOD(Ice_Communicator, destroy) { CommunicatorInfoIPtr _this = Wrapper<CommunicatorInfoIPtr>::value(getThis() TSRMLS_CC); @@ -1456,6 +1502,9 @@ static zend_function_entry _interfaceMethods[] = static zend_function_entry _classMethods[] = { ZEND_ME(Ice_Communicator, __construct, ICE_NULLPTR, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR) + ZEND_ME(Ice_Communicator, shutdown, ICE_NULLPTR, ZEND_ACC_PUBLIC) + ZEND_ME(Ice_Communicator, isShutdown, ICE_NULLPTR, ZEND_ACC_PUBLIC) + ZEND_ME(Ice_Communicator, waitForShutdown, ICE_NULLPTR, ZEND_ACC_PUBLIC) ZEND_ME(Ice_Communicator, destroy, ICE_NULLPTR, ZEND_ACC_PUBLIC) ZEND_ME(Ice_Communicator, stringToProxy, ICE_NULLPTR, ZEND_ACC_PUBLIC) ZEND_ME(Ice_Communicator, proxyToString, ICE_NULLPTR, ZEND_ACC_PUBLIC) |