Passing a large data structure over dbus

不羁岁月 提交于 2019-11-30 21:01:23

I don't think Dbus is really the best way to send large amounts of data.

How about writing the data structure out to a file in /tmp, and just passing the filename between the programs via dbus instead?

Shnatsel

D-bus won't let you pass more than 128Mb of data per message, and the limit is usually set to even lower value in /etc/dbus-1/session.conf

A named pipe is what you're looking for. It's like a temporary file except that the data is not written to disk, but streamed from one process to another with very low overhead. It has no limits on data size. See http://en.wikipedia.org/wiki/Named_pipe and Create a temporary FIFO (named pipe) in Python? for details.

One simple solution that comes to my mind right now is to separate the data structure.. Separate it, send each piece and join it together on the other program. Of course, some care would be necessary to assure that you would join it correctly.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!