Publish/Subscribe or Notifications

61 views
Skip to first unread message

MatMat

unread,
Apr 12, 2013, 4:36:33 AM4/12/13
to web...@googlegroups.com
Hi,

I recently discovered WebSync and find that this product is really great.
Before going further with WebSync,I want to be sure that it is adapted to my needs.
The project I am working on require Server Sent Events from a Web Portal to many clients that runs on .Net Compact Framework.
But instead of the WebSync samples such as Chat application, I only need to send a message to a specific client, never to all or many of them.
I saw this was feasible with WebSync by using Notify features, but is it a good idea to use WebSync in that way? 
Another option, would be to use a kind of dynamic channel that would be unique for each client and identified by its serial number.
What is for you the best solution?

Thanks in advance,
Mathieu

Ben Swayne

unread,
Apr 12, 2013, 1:27:49 PM4/12/13
to web...@googlegroups.com
Hi Mathieu,

The WebSync Notify method will send a message to a specific client Id which is one instance of a WebSync client. It is primarily intended for system level notifications (for example some server side code could subscribe on unsubscribe that client from a channel and it would never know, except for the notify techniques). The client Id is only used for the lifespan of the currently connected instance. For example if your WinCE device loses its connection (internet service disruption) it will get a new client Id when it reconnects. Also if the device reboots it will get a new client Id as when it first connects. From the perspective of a WinCE device or appliance, the client Id is short lived and shouldn't really be significant to your application.

WebSync "Channels" are simply an arbitrary way of organizing subscriptions and messages. A channel could have only one subscriber or many subscribers. In your case if you subscribed to a channel using the devices serial number as part of the channel (ex: "/devices/6c3037e3-89e2-43fb-afcd-053db6003bc5"). This channel will have only one subscriber and be the same every time the WinCE device connects, reboots, internet goes down and it reconnects, etc... So this is the most consistent pattern over time. If only one client is subscribed to that special serial number channel, only one client will receive the notification! WebSync server is very efficient in this fashion (the processing cost of 1 message to 1 subscriber on the server will be the same as the processing cost for 1 notify message to 1 client).

As an example, let's say you are building a websync powered TV tuner appliance. You want to be able to change the channel on your TV tuner using your cell phone. So you program a windows CE embedded computer using a websync client. When the WinCE tuner appliance boots up, it subscribes to the special channel using its serial number. Now you write an app which can publish messages to that channel to command it to "change channels". Anytime a message is received on that channel your TV tuner will change the channel as requested. Now if the internet connection is lost, the tuner appliance will boot up and again subscribe to the same channel using its serial number as before. The client Id will be different, but the channel will be the same.

Does this answer your question regarding Notify vs. Subscribe & Publish?


Ben Swayne
Frozen Mountain Software
888-379-6686 (Extension 
103)
www.frozenmountain.com



--
You received this message because you are subscribed to the Google Groups "WebSync" group.
To unsubscribe from this group and stop receiving emails from it, send an email to websync+u...@googlegroups.com.
To post to this group, send email to web...@googlegroups.com.
Visit this group at http://groups.google.com/group/websync?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/websync/-/AaWZne7ndSMJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

MatMat

unread,
Apr 15, 2013, 6:13:56 AM4/15/13
to web...@googlegroups.com
Hi Ben,

First of all thanks for your answer. 
Based on your answer, we will use a publish/subscribe architecture with dynamic channels identified by a client ID.
All my devices runs on Compact Framework 3.5, is WebSocket protocol supported for this kind of clients or is it reserved for .Net 4 clients? I didn't find any information on protocol compatibility for .Net CF.
Best regards,
Mathieu

Ben Swayne

unread,
Apr 15, 2013, 10:52:07 AM4/15/13
to web...@googlegroups.com
Hi Mathieu,

We do have compact framework clients for both 2.0 and 3.5 at this time. Both versions support WebSockets.

The limitation is on the server side, you must be running Windows Server 2012 (or Windows 8 for development) and IIS 8.

For more information on server compatibility check out Microsoft's website: http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-websocket-protocol-support

Regards,

Ben Swayne
Frozen Mountain Software
888-379-6686 (Extension 
103)
www.frozenmountain.com



To view this discussion on the web visit https://groups.google.com/d/msg/websync/-/Hnnd2ZhzaFoJ.
Reply all
Reply to author
Forward
0 new messages