One of the challenges using Windows RTs is to send messages from a store application deployed on one Windows RT tablet (Surface RT in my case) to the other application on another Windows RT tablet. It is a challenge, mainly because it requires push (two-way communications, like WCF duplex channel) messaging and limitations on Windows RT platform (can’t be domain-joined, no queues, you can’t deploy any Win-32 type application, app container etc.).
SignalR, developed by an MS team, is an API (part of ASP.NET framework, starting from .NET 4.5+) that provides simplified real-time and bi-directional communication. So, the relevant keywords would be:
Link to SignalR Server API
Link to SignalR Client API
Link to SignalR Hub API
The solution detailed here demonstrates a case scenario in which tablet users communicate each other by sending messages from the store applications deployed in their Windows RT devices.
Figure#1: POC solution structure
Figure#2: POC solution message flow
As you see, the solution combines Windows Azure cloud services representing SignalR server and 2 Windows store applications representing SignalR clients running on Surface RT devices. Unfortunately, I can’t cover all those things in the picture, so will focus on client API calls for now.
Here are the simplified steps:
_hubConnection = new HubConnection(_url);
_hubProxy = _hubConnection.CreateHubProxy(_hubName);
var joinGroupResponse =
await _hubProxy.Invoke<string>("JoinGroup", _hubConnection.ConnectionId, groupName);
From there, you can send messages from either app. All the messages passed/received along with their trace data are written to textbox (center panel).
Figure#3: HubConnection (Client) class members
Figure#4: Hub (Server) class members
Please note these:
In conclusion, you must consider SignalR API when developing modern applications wherever you need to have push-based functionality. Big thanks goes to the SignalR team, well done in a short time!