Page 1 of 1

No-polling 2-way interface

Posted: Mon Apr 06, 2009 9:28 pm
by Digit
I'm currently working on the foundations for my homebrew Touch application. It's going to be written in VB.NET and will run on my ASUS TOP.

Now i'm considering a few options on how to supply this Touch application with data it has to show on the screen.
I could periodically query the database. Everything needed is in there.
Or i could query my HA application by means of XML-RPC.

I have both methods available and ready to run, but i'm not sure if this is the best way to do it.
I would prefer having a mechanism that pushes new information to the Touch app as soon as it becomes available; i just don't want to use polling on the Touch-side to get the info available to the Touch.

Now you could implement XML-RPC in 2-way:
1 for Touch -> HA for things like user activity on the Touch,
and another one for HA -> Touch meant for displaying changed data on the Touch screen.

Any suggestions on other ways to accomplish what i want, without polling?

No-polling 2-way interface

Posted: Mon Apr 06, 2009 9:41 pm
by Rene
From what you are describing I guess you are using HTTP as the communication protocol between the touch and HA application. Why are you not using a persistent connection? Using a persistent connection, you can push new info as soon as it becomes available in your HA application.

Rene.

No-polling 2-way interface

Posted: Mon Apr 06, 2009 9:43 pm
by Mdamen
You could for example use socketjs:

http://dev.dschini.org/socketjs/

Implement a server socket in your application and then write to the client socket as soon as data becomes available.

--
Maarten Damen

www.maartendamen.com

No-polling 2-way interface

Posted: Mon Apr 06, 2009 11:26 pm
by Digit
Thanks Rene, keep-alive can be a good solution too, haven't tried that one yet. I'll give it a try.
Maarten thanks for the tip, i didn't mention it but i was talking about 2 Windows Forms applications :-)

No-polling 2-way interface

Posted: Tue Apr 07, 2009 1:36 am
by Esteban
For HS -> Touch you could something like UDP broadcasting? Every client then just picks up whatever events you broadcast.

Ciao,
Esteban

No-polling 2-way interface

Posted: Tue Apr 07, 2009 8:10 pm
by Digit
Thanks Esteban for reminding me :-)
I am already using UDP broadcast for some time for another purpose: broadcasting incoming phone calls to all the PC's where a tiny tool will pop up and display the phone number. (why didn't i think of that)
I've altered my HA application to broadcast every change over UDP and added a listener to my Touch app. I think this is good enough.
For the Touch -> HA direction i think i will first try XML-RPC; this also gives me SSL when i need it.

Thanks for all your suggestions.