summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/Connection.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-10-16 09:38:13 -0230
committerDwayne Boone <dwayne@zeroc.com>2009-10-16 09:38:13 -0230
commitb8b803f51c8ff622491d2a160663e4912f7dba03 (patch)
treeb4ded20bd5b2fa37a18943a5ac0665ce2d525128 /py/modules/IcePy/Connection.cpp
parentAdded support for per-OA ACM and fix for retry on CloseConnectionException (diff)
downloadice-b8b803f51c8ff622491d2a160663e4912f7dba03.tar.bz2
ice-b8b803f51c8ff622491d2a160663e4912f7dba03.tar.xz
ice-b8b803f51c8ff622491d2a160663e4912f7dba03.zip
Added support for EndpointInfo and ConnectionInfo to python.
Set endpoint in Connection getInfo implementations. Removed unused _stateTime from ConnectionI. Remove ["cpp:virtual"] from SSLEndpointInfo slice definition.
Diffstat (limited to 'py/modules/IcePy/Connection.cpp')
-rw-r--r--py/modules/IcePy/Connection.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/py/modules/IcePy/Connection.cpp b/py/modules/IcePy/Connection.cpp
index 3bf3e761639..e373f1c1f17 100644
--- a/py/modules/IcePy/Connection.cpp
+++ b/py/modules/IcePy/Connection.cpp
@@ -11,6 +11,7 @@
# include <IceUtil/Config.h>
#endif
#include <Connection.h>
+#include <ConnectionInfo.h>
#include <ObjectAdapter.h>
#include <Proxy.h>
#include <Util.h>
@@ -281,6 +282,25 @@ connectionToString(ConnectionObject* self)
return createString(str);
}
+#ifdef WIN32
+extern "C"
+#endif
+static PyObject*
+connectionGetInfo(ConnectionObject* self)
+{
+ assert(self->connection);
+ try
+ {
+ Ice::ConnectionInfoPtr info = (*self->connection)->getInfo();
+ return createConnectionInfo(info);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ setPythonException(ex);
+ return 0;
+ }
+}
+
static PyMethodDef ConnectionMethods[] =
{
{ STRCAST("close"), reinterpret_cast<PyCFunction>(connectionClose), METH_VARARGS,
@@ -299,6 +319,8 @@ static PyMethodDef ConnectionMethods[] =
PyDoc_STR(STRCAST("timeout() -> int")) },
{ STRCAST("toString"), reinterpret_cast<PyCFunction>(connectionToString), METH_NOARGS,
PyDoc_STR(STRCAST("toString() -> string")) },
+ { STRCAST("getInfo"), reinterpret_cast<PyCFunction>(connectionGetInfo), METH_NOARGS,
+ PyDoc_STR(STRCAST("getInfo() -> Ice.ConnectionInfo")) },
{ 0, 0 } /* sentinel */
};