Sunday, 10 August 2014

Information Technology : SignalR Communication

What is SignalR ?

SignalR is a component library which provides the following..
a.real time functionality to our applications.
b.a very simple, high-level API for doing server to client RPC.
c.automatic connection management.

What is meant by real time functionality ?
It's the ability to have your server-side code push content to the connected clients as it happens, in real-time.

What is meant by RPC?

RPC stands for Remote Procedure Calls which (in SignalR) is meant for calling JavaScript functions in your clients' browsers from server-side .NET code.

What are all Connection management?
Connect/Disconnect events, grouping connections, authorization are part of connection management.

How special is SignalR apart from realtime functionality or 
How SignalR communicates with connected clients?
SignalR will use WebSockets when it's available, and gracefully fallback to other techniques and technologies when it isn't, while your application code stays the same.

In what language does SignalR programs can be written?

How SignalR APIs are simple between server-client communications?
For Server to Client - Clients.Client(id).myClientFunc()
For Client to Server - $.connection.myHub.server.myServerFunc()

Tell me about SignalR Connections.
SignalR handles connection management automatically, and lets you broadcast messages to all connected clients simultaneously, like a chat room. You can also send messages to specific clients. The connection between the client and server is persistent, unlike a classic HTTP connection, which is re-established for each communication.
A SignalR connection starts as HTTP, and is then promoted to a WebSocket connection if it is available.

How SignalR communicates?
SignalR uses the new WebSocket transport where available, and falls back to older transports where necessary. 

If it is a HTML5 transport,
First Priority : Websocket.
(if the both the server and browser indicate they can support Websocket)
Latest versions of Microsoft Internet Explorer, Google Chrome, and Mozilla Firefox uses WebSocket

Second Priority : Server sent events
All browsers except Internet Explorer

If it is a Comet transport(a long-held HTTP request),

Forever Frame (for Internet Explorer only). 
Forever Frame creates a hidden IFrame which makes a request to an endpoint on the server that does not complete. 
The server then continually sends script to the client which is immediately executed, providing a one-way realtime connection from server to client. 
The connection from client to server uses a separate connection from the server to client connection, and like a standard HTML request, a new connection is created for each piece of data that needs to be sent.

Ajax long polling. Long polling does not create a persistent connection, but instead polls the server with a request that stays open until the server responds, at which point the connection closes, and a new connection is requested immediately. This may introduce some latency while the connection resets.

(to be continued...)

10th Aug 2014

No comments:

Related Posts