tag:blogger.com,1999:blog-6863089.post5163019955710291824..comments2024-03-27T07:21:52.928+00:00Comments on Geek Thoughts: D-Bus Experiments in ValaAnonymoushttp://www.blogger.com/profile/01600375579955596177noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-6863089.post-23553179081309250082013-05-01T08:15:02.246+01:002013-05-01T08:15:02.246+01:00@Anonymous: Vala is a language that evolves very q...@Anonymous: Vala is a language that evolves very quickly so if you are using a recent version, my code will likely not compile. If I can find the time to debug it I will and will then post updated code here. Although based on your errors, it seems the code got mangled when you copied it.Anonymoushttps://www.blogger.com/profile/01600375579955596177noreply@blogger.comtag:blogger.com,1999:blog-6863089.post-37463725364100358462013-04-22T13:31:40.169+01:002013-04-22T13:31:40.169+01:00$ valac --pkg gio-2.0 peer.vala
peer.vala:100.1-10...$ valac --pkg gio-2.0 peer.vala<br />peer.vala:100.1-100.1: error: syntax error, expected declaration<br />v[DBus (name = "org.example.Demo")]<br />^<br />peer.vala:101.1-101.29: error: The root namespace already contains a definition for `DemoClient'<br />interface DemoClient : Object {<br />^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br />peer.vala:2.1-2.29: note: previous definition of `Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6863089.post-87407918754636010932011-09-25T23:07:15.675+01:002011-09-25T23:07:15.675+01:00Regarding the compilation error, you should correc...Regarding the compilation error, you should correct line 44 to read this:<br /><br />Thread.create<void*> (() => {<br /><br />But there now seems to be another problem when starting the client thread the first time you run the peer program so I'll have to investigate further.Anonymoushttps://www.blogger.com/profile/01600375579955596177noreply@blogger.comtag:blogger.com,1999:blog-6863089.post-84633470293470622312011-09-25T22:51:00.255+01:002011-09-25T22:51:00.255+01:00Javin, I don't disagree with you. However, thi...Javin, I don't disagree with you. However, this article is not meant to present a short solution but one that is easy to understand. Also note that I am a rookie in Vala so I may have overlooked some simplification as pointed out in the first comment. Having said this, if you have example code that does inter-process communication over D-Bus in Java, feel free to post it, it'd be Anonymoushttps://www.blogger.com/profile/01600375579955596177noreply@blogger.comtag:blogger.com,1999:blog-6863089.post-25530422503511151472011-09-25T15:52:27.400+01:002011-09-25T15:52:27.400+01:00This is first time I heard about Vala , my ignoran...This is first time I heard about Vala , my ignorant but the solution which you have presented its seems to be longer than in case if I write same program in Java.Javin @ java enum`http://javarevisited.blogspot.com/2011/08/enum-in-java-example-tutorial.htmlnoreply@blogger.comtag:blogger.com,1999:blog-6863089.post-71466422318769953082011-09-25T12:27:22.004+01:002011-09-25T12:27:22.004+01:00It's probably because your valac is newer than...It's probably because your valac is newer than the one I used when I wrote this, rather than older. Vala has moved a lot over the past 12 months. I have valac 0.12 on my machine so will try out and report. My guess is that they made the Thread.create method more restrictive in terms of the types you can pass to it.Anonymoushttps://www.blogger.com/profile/01600375579955596177noreply@blogger.comtag:blogger.com,1999:blog-6863089.post-78895678777520939582011-09-25T09:54:09.349+01:002011-09-25T09:54:09.349+01:00Hi,
Can't seem to compile the peer.vala and t...Hi,<br /><br />Can't seem to compile the peer.vala and the second client.vala example. The compilation error is:<br /><br />$ valac --pkg gio-2.0 peer.vala <br />peer.vala:43.13-43.25: error: cannot infer generic type argument for type parameter `GLib.Thread.create.T'<br /> Thread.create(() => {<br /> ^^^^^^^^^^^^^<br />Compilation failed: 1 error(s), 0 warning(s)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6863089.post-89228072874983053942011-02-12T17:43:57.268+00:002011-02-12T17:43:57.268+00:00Thanks for the comment: I just tried and you'r...Thanks for the comment: I just tried and you're right, you can remove the start_server()line in the start() function and it still works. Good to know!Anonymoushttps://www.blogger.com/profile/01600375579955596177noreply@blogger.comtag:blogger.com,1999:blog-6863089.post-84916062559101744992011-02-12T13:46:04.180+00:002011-02-12T13:46:04.180+00:00In the last example you do not need to start the s...In the last example you do not need to start the server at the start.<br />watch_name() is guaranteed to execute either appeared or vanished callback at the start.Anonymousnoreply@blogger.com