summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/Connection.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2015-03-05 15:44:08 -0330
committerDwayne Boone <dwayne@zeroc.com>2015-03-05 15:44:08 -0330
commitb96b045ecc6e034307ba8065af73c252e0093bbb (patch)
treec3f22df1c67a7de3c435c4be31ef2adfb300b1e8 /py/modules/IcePy/Connection.cpp
parentFixed linux php build (diff)
downloadice-b96b045ecc6e034307ba8065af73c252e0093bbb.tar.bz2
ice-b96b045ecc6e034307ba8065af73c252e0093bbb.tar.xz
ice-b96b045ecc6e034307ba8065af73c252e0093bbb.zip
ICE-6082 No way to discover send/recv buffer sizes
Diffstat (limited to 'py/modules/IcePy/Connection.cpp')
-rw-r--r--py/modules/IcePy/Connection.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/py/modules/IcePy/Connection.cpp b/py/modules/IcePy/Connection.cpp
index 70e03ee5260..c761419993a 100644
--- a/py/modules/IcePy/Connection.cpp
+++ b/py/modules/IcePy/Connection.cpp
@@ -710,6 +710,34 @@ connectionGetEndpoint(ConnectionObject* self)
}
}
+#ifdef WIN32
+extern "C"
+#endif
+static PyObject*
+connectionSetBufferSize(ConnectionObject* self, PyObject* args)
+{
+ int rcvSize;
+ int sndSize;
+ if(!PyArg_ParseTuple(args, STRCAST("ii"), &rcvSize, &sndSize))
+ {
+ return 0;
+ }
+
+ assert(self->connection);
+ try
+ {
+ (*self->connection)->setBufferSize(rcvSize, sndSize);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ setPythonException(ex);
+ return 0;
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
static PyMethodDef ConnectionMethods[] =
{
{ STRCAST("close"), reinterpret_cast<PyCFunction>(connectionClose), METH_VARARGS,
@@ -742,6 +770,8 @@ static PyMethodDef ConnectionMethods[] =
PyDoc_STR(STRCAST("getInfo() -> Ice.ConnectionInfo")) },
{ STRCAST("getEndpoint"), reinterpret_cast<PyCFunction>(connectionGetEndpoint), METH_NOARGS,
PyDoc_STR(STRCAST("getEndpoint() -> Ice.Endpoint")) },
+ { STRCAST("setBufferSize"), reinterpret_cast<PyCFunction>(connectionSetBufferSize), METH_VARARGS,
+ PyDoc_STR(STRCAST("setBufferSize(int, int) -> None")) },
{ 0, 0 } /* sentinel */
};