summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/Proxy.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-05-23 11:59:44 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-05-23 11:59:44 +0200
commitd81701ca8182942b7936f9fd84a019b695e9c890 (patch)
treedc036c9d701fbbe1afad67782bd78572c0f61974 /py/modules/IcePy/Proxy.cpp
parentFixed bug ICE-5543: stringToIdentity bug with escaped escapes (diff)
downloadice-d81701ca8182942b7936f9fd84a019b695e9c890.tar.bz2
ice-d81701ca8182942b7936f9fd84a019b695e9c890.tar.xz
ice-d81701ca8182942b7936f9fd84a019b695e9c890.zip
Added support for invocation timeouts and ACM heartbeats
Diffstat (limited to 'py/modules/IcePy/Proxy.cpp')
-rw-r--r--py/modules/IcePy/Proxy.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/py/modules/IcePy/Proxy.cpp b/py/modules/IcePy/Proxy.cpp
index bac390c3e5a..1143d6d1fad 100644
--- a/py/modules/IcePy/Proxy.cpp
+++ b/py/modules/IcePy/Proxy.cpp
@@ -772,6 +772,26 @@ proxyIceGetLocatorCacheTimeout(ProxyObject* self)
extern "C"
#endif
static PyObject*
+proxyIceGetInvocationTimeout(ProxyObject* self)
+{
+ assert(self->proxy);
+
+ try
+ {
+ Ice::Int timeout = (*self->proxy)->ice_getInvocationTimeout();
+ return PyLong_FromLong(timeout);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ setPythonException(ex);
+ return 0;
+ }
+}
+
+#ifdef WIN32
+extern "C"
+#endif
+static PyObject*
proxyIceGetConnectionId(ProxyObject* self)
{
assert(self->proxy);
@@ -820,6 +840,34 @@ proxyIceLocatorCacheTimeout(ProxyObject* self, PyObject* args)
extern "C"
#endif
static PyObject*
+proxyIceInvocationTimeout(ProxyObject* self, PyObject* args)
+{
+ int timeout;
+ if(!PyArg_ParseTuple(args, STRCAST("i"), &timeout))
+ {
+ return 0;
+ }
+
+ assert(self->proxy);
+
+ Ice::ObjectPrx newProxy;
+ try
+ {
+ newProxy = (*self->proxy)->ice_invocationTimeout(timeout);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ setPythonException(ex);
+ return 0;
+ }
+
+ return createProxy(newProxy, *self->communicator, reinterpret_cast<PyObject*>(Py_TYPE(self)));
+}
+
+#ifdef WIN32
+extern "C"
+#endif
+static PyObject*
proxyIceIsConnectionCached(ProxyObject* self)
{
assert(self->proxy);
@@ -2243,10 +2291,14 @@ static PyMethodDef ProxyMethods[] =
PyDoc_STR(STRCAST("ice_endpoints(tuple) -> proxy")) },
{ STRCAST("ice_getLocatorCacheTimeout"), reinterpret_cast<PyCFunction>(proxyIceGetLocatorCacheTimeout),
METH_NOARGS, PyDoc_STR(STRCAST("ice_getLocatorCacheTimeout() -> int")) },
+ { STRCAST("ice_getInvocationTimeout"), reinterpret_cast<PyCFunction>(proxyIceGetInvocationTimeout),
+ METH_NOARGS, PyDoc_STR(STRCAST("ice_getInvocationTimeout() -> int")) },
{ STRCAST("ice_getConnectionId"), reinterpret_cast<PyCFunction>(proxyIceGetConnectionId),
METH_NOARGS, PyDoc_STR(STRCAST("ice_getConnectionId() -> string")) },
{ STRCAST("ice_locatorCacheTimeout"), reinterpret_cast<PyCFunction>(proxyIceLocatorCacheTimeout), METH_VARARGS,
PyDoc_STR(STRCAST("ice_locatorCacheTimeout(int) -> Ice.ObjectPrx")) },
+ { STRCAST("ice_invocationTimeout"), reinterpret_cast<PyCFunction>(proxyIceInvocationTimeout), METH_VARARGS,
+ PyDoc_STR(STRCAST("ice_invocationTimeout(int) -> Ice.ObjectPrx")) },
{ STRCAST("ice_isConnectionCached"), reinterpret_cast<PyCFunction>(proxyIceIsConnectionCached), METH_NOARGS,
PyDoc_STR(STRCAST("ice_isConnectionCached() -> bool")) },
{ STRCAST("ice_connectionCached"), reinterpret_cast<PyCFunction>(proxyIceConnectionCached), METH_VARARGS,