diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-10-16 09:38:13 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-10-16 09:38:13 -0230 |
commit | b8b803f51c8ff622491d2a160663e4912f7dba03 (patch) | |
tree | b4ded20bd5b2fa37a18943a5ac0665ce2d525128 /py/modules/IcePy/Endpoint.cpp | |
parent | Added support for per-OA ACM and fix for retry on CloseConnectionException (diff) | |
download | ice-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/Endpoint.cpp')
-rw-r--r-- | py/modules/IcePy/Endpoint.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/py/modules/IcePy/Endpoint.cpp b/py/modules/IcePy/Endpoint.cpp index 3dee6fae2d4..1c9eefd52ad 100644 --- a/py/modules/IcePy/Endpoint.cpp +++ b/py/modules/IcePy/Endpoint.cpp @@ -11,6 +11,7 @@ # include <IceUtil/Config.h> #endif #include <Endpoint.h> +#include <EndpointInfo.h> #include <Util.h> using namespace std; @@ -75,10 +76,31 @@ endpointRepr(EndpointObject* self) return endpointToString(self); } +#ifdef WIN32 +extern "C" +#endif +static PyObject* +endpointGetInfo(EndpointObject* self) +{ + assert(self->endpoint); + try + { + Ice::EndpointInfoPtr info = (*self->endpoint)->getInfo(); + return createEndpointInfo(info); + } + catch(const Ice::Exception& ex) + { + setPythonException(ex); + return 0; + } +} + static PyMethodDef EndpointMethods[] = { { STRCAST("toString"), reinterpret_cast<PyCFunction>(endpointToString), METH_NOARGS, PyDoc_STR(STRCAST("toString() -> string")) }, + { STRCAST("getInfo"), reinterpret_cast<PyCFunction>(endpointGetInfo), METH_NOARGS, + PyDoc_STR(STRCAST("getInfo() -> Ice.EndpointInfo")) }, { 0, 0 } /* sentinel */ }; @@ -91,7 +113,7 @@ PyTypeObject EndpointType = * to be portable to Windows without using C++. */ PyObject_HEAD_INIT(0) 0, /* ob_size */ - STRCAST("Ice.Endpoint"), /* tp_name */ + STRCAST("IcePy.Endpoint"), /* tp_name */ sizeof(EndpointObject), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ |