summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/Connection.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-10-23 10:00:17 -0230
committerDwayne Boone <dwayne@zeroc.com>2009-10-23 10:00:17 -0230
commit278f7856b4b906aea4199eda8294b46064ec4ce8 (patch)
tree6ac95560911cad6acb3253b5d5d258dbea993edc /py/modules/IcePy/Connection.cpp
parentPHP fixes for 5.3 (diff)
downloadice-278f7856b4b906aea4199eda8294b46064ec4ce8.tar.bz2
ice-278f7856b4b906aea4199eda8294b46064ec4ce8.tar.xz
ice-278f7856b4b906aea4199eda8294b46064ec4ce8.zip
Port latest Endpoint/ConnectionInfo changes to python/ruby
Added Ice/info test to python/ruby Modified allTest to not run info test for compress or ipv6 Added Endpoint comparison methods to python/ruby
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 e373f1c1f17..2d1cba09c5f 100644
--- a/py/modules/IcePy/Connection.cpp
+++ b/py/modules/IcePy/Connection.cpp
@@ -12,6 +12,7 @@
#endif
#include <Connection.h>
#include <ConnectionInfo.h>
+#include <Endpoint.h>
#include <ObjectAdapter.h>
#include <Proxy.h>
#include <Util.h>
@@ -301,6 +302,25 @@ connectionGetInfo(ConnectionObject* self)
}
}
+#ifdef WIN32
+extern "C"
+#endif
+static PyObject*
+connectionGetEndpoint(ConnectionObject* self)
+{
+ assert(self->connection);
+ try
+ {
+ Ice::EndpointPtr endpoint = (*self->connection)->getEndpoint();
+ return createEndpoint(endpoint);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ setPythonException(ex);
+ return 0;
+ }
+}
+
static PyMethodDef ConnectionMethods[] =
{
{ STRCAST("close"), reinterpret_cast<PyCFunction>(connectionClose), METH_VARARGS,
@@ -321,6 +341,8 @@ static PyMethodDef ConnectionMethods[] =
PyDoc_STR(STRCAST("toString() -> string")) },
{ STRCAST("getInfo"), reinterpret_cast<PyCFunction>(connectionGetInfo), METH_NOARGS,
PyDoc_STR(STRCAST("getInfo() -> Ice.ConnectionInfo")) },
+ { STRCAST("getEndpoint"), reinterpret_cast<PyCFunction>(connectionGetEndpoint), METH_NOARGS,
+ PyDoc_STR(STRCAST("getInfo() -> Ice.Endpoint")) },
{ 0, 0 } /* sentinel */
};