PDA

View Full Version : DBus over Network?



shensel
25th March 2009, 10:06
Hi all,

well I got my DBus applications running on Windows and Linux :)

Now I want to use the DBus functionality across an intranet.

I tried and configured and read and searched and tried again.... Up to now I still dont know if this is possible when using QtDBus and which settings to use.

::Scanario::
Imagine some clients and one server. I can configure them all as I want to with dbus-daemon or not, firewalls off. The clients are demanding services and data by DBus from the server.

The point is simple, I got a high performance multi-application scenario with powerfuel algorithms but not a lot of data flow. These algos need a lot of CPU power, so I can not start them all locally on the linux embedded system. Some apps I have to start on more powerfuel machines. The software dont need to know if it is started locally or on other systems if I could use DBus. If processor performance grows I just could start the apps all on embedded side without recompiling :)

::Tests::
My tests did'nt bring up any connection by configuring:

- dbus env.variables
- session.conf
- system.conf

::#1 thought::
I thought about setting the session.conf to use listen for services on a specific IP/DNS (just replace localhost) but I did not succeed. Will I need a dbus-daemon on client side or may be it is enough to set the dbus environment variables to look for a remote dbus-daemon?

::#2 thought::
I have to changed something inside the QtDBus settings and recompile the QtDBus libs

::#3 thought:: :crying:
It is not possible, because DBus TCP usage differs from 'normal' TCP usage. DBus is event based and puts all content into one single big package where standard TCP will split packages into many.

::#4 thought::
Mikael Hallendal wrote he once implemented an dbus-transporter for TCP but he do not know if it is still working...

Thanks for reading my poor english.
I hope you can enlighten me.
Sebastian

QPlace
25th March 2009, 13:57
Sebastian,

If it is not a closely guarded secret - can you please post a short instructions and a sample of compiling and using DBus on Windows?

shensel
25th March 2009, 16:32
Well, I can.

1st I received an answer from the QtDBus master himself:
It is possible, but without authentication and cryptography support.
... but I am on my own to figure out how to :eek:
So this toppic still lurks for a solution.

I'll reply soon some samples.

QPlace
25th March 2009, 17:09
Thank you!
I am very excited that you agreed to help with this issue and I am looking forward to read the instruction of how to successfully compile QtDBus for windows and may be a simplest sample of usage on Windows.

wysota
25th March 2009, 23:22
We have tried to launch D-BUS over network in a heterogenous (Linux/Windows) environment but it didn't work. The Windows D-BUS implementation was simply crashing (maybe it wasn't mature enough at the time), guys at (then) Trolltech said it wasn't possible to make a network connection between two busses, etc. What seemed possible (although didn't work because of the crashing Windows implementation) was a peer-to-peer network connection between two clients.

Then I came up with an idea to solve the problem. I thought about creating a simple application that would act as a proxy - it would be installed on both machines and would register objects on a local bus that would be pointed out by the remote end. Then if any message came to the proxy object, it would be transferred over network to the other end of the proxy and distributed on the other bus (and vice versa). I didn't find time to actually implement it but conceptually it should work. If you have time to spare, you could try implementing such a proxy system.

shensel
26th March 2009, 11:12
thx wysota. WinDBus works, but I also saw the crashes you described with the latest Version of dbus-daemon when trying to communicate over network.

My little WinDBus to QtDBus description:

1. download bin, src and libs from http://sourceforge.net/projects/windbus
(I picked the msvc version)
2. you don't need to compile WinDBus, it is already build
3. copy src into: c:\Qt\4.5.0\src\dbus\dbus (131 files, no more subdirs)
4. copy dbus-1.dll and dbus-1d.dll to c:\Qt\4.5.0\bin
(QtDBus libs and dlls will look for it, but you wont get an error if it isn't found)
5. copy dbus-1.lib and dbus-1d.lib to c:\Qt\4.5.0\lib
6. copy dbus executables to something like
C:\Qt\dbus-1.2.4.1\msvc\bin\
C:\Qt\dbus-1.2.4.1\msvc\etc\
libexpat.dll must be in the \bin\ too

now you have to rebuild the Qt which will also build up QtDBus4.lib QtDBusd4.lib QtDBus4.dll QtDBusd4.dll

1. run Start/Programs/MS VC 2005/MS VC Tools/Visual Studio 2005 Command Prompt
2. goto c:\Qt\4.5.0\
3. you have to configure Qt to build up makefiles with nmake then.
3.1 nmake confclean (enter) do this 1st. nothing happensif this is your 1st time
3.2 configure -debug_and_release -dbus (enter)
//optional: -qt-sql-sqlite -no-qt3support -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg -qt-style-windows -qt-style-windowsxp -qt-style-windowsvista -qt-style-plastique
3.3 call nmake (enter) ... wait some hours or call nmake in c:\Qt\4.5.0\src\dbus

4. if everything succeeded you got
QtDBus4.lib QtDBusd4.lib QtDBus4.dll QtDBusd4.dll
in c:\Qt\4.5.0\lib\ :)

TEST
run C:\Qt\dbus-1.2.4.1\msvc\bin\dbus-launch.exe (starts dbus daemon)
run C:\Qt\dbus-1.2.4.1\msvc\bin\dbus-monitor.exe
execute the samples which can be found in
C:\Qt\4.5.0\examples\dbus\

within the bin\ look for qdbusviewer.exe too

thats it. then you can try to change the samples for experimenting
have fun!

Sebastian