Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

SignalR With ASP.Net part1


Published on

Signalr Introduction, and How do I get SignalR with simple demo.

Published in: Software
  • Be the first to comment

SignalR With ASP.Net part1

  1. 1. Topics Focused On!!! • Traditional Web Approach – Traditional Web Approach – Issues • What does “Real Time” mean? • SignalR – Types of Transports – Types of Connections • How do I get SignalR? • Demo
  2. 2. Traditional Web Approach “Pulling”
  3. 3. CLIENT SERVER Traditional Web Approach Sends a Request to the Server – (Step 1) [In other words, the Client is trying to pull some information from the Server] Processes the Request (Step 2) Response Sent back to the Client – (Step 3)
  4. 4. • Not Persistent connection – Issues Each time re-established for each communication. • Http Request – Issues
  5. 5. Real Time Web Applications
  6. 6. What is Real Time Web Application? • “Real Time” means an immediate response being sent by the Server to the Client. • Real Time is “Pushing” instead of “Pulling” • Push Technology is completely different from Pull Technology. Its about getting told what’s new, instead of asking for what’s new!!!
  7. 7. CLIENT SERVER User Sends a Request to the Server Creates a Persistent Connection between them Real Time Web Approach Response Sent back to the Client Response Sent back to the Client Response Sent back to the Client
  8. 8. Comet Transports
  9. 9. Long Polling Server Client Request Response Variable delay • 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.
  10. 10. Forever Frames • Internally creates an Iframe along with a script on the page to fetch the data. • The server then continually sends script to the client which is immediately executed, providing a one-way realtime connection from server to client. • Supported on IE Browser.
  11. 11. HTML5 Transports
  12. 12. Server Sent Events
  13. 13. Server Sent Events • Requires a single connection between Client-Server. • Works in server-to-client direction only • Used to send Message Notifications or Continuous Data Streams. • Support a lot of Browsers but Not supported in IE.
  14. 14. WebSocket
  15. 15. WebSocket • A new HTML5 API that enables bi-directional, full duplex communication between the browser and server. • Fastest solution • Issues – Supported only on latest browsers – Works only with IIS-8.0
  16. 16. SignalR • SignalR is a library for ASP.NET developers. Used to develop Real Time Web Application. • Makes use of Push Technology. • Provides Abstraction over the set of transports. • Open Source available on Github!!!
  17. 17. SignalR Transport Techniques Connections
  18. 18. Transport Priority WebSockets Server-Sent events Forever Frame (IE hack) Long Polling HTML 5 transports Comet transports
  19. 19. SignalR Connections Hubs Persistent Connection
  20. 20. Persistent Connection • low-level control to manage connection. • Contain events like “OnConnection”, “OnDisconnection”, “OnReconnection” • We can write our own logic in these events.
  21. 21. Hubs
  22. 22. Hubs • Provides a High-level API. • Client calling Server. • Server calling Clients. (All, Groups, One). • Broadcasting messages to all connected clients.
  23. 23. Connection lifetime
  24. 24. Connection lifetime
  25. 25. How do I get SignalR?
  26. 26. Install-Package Microsoft.AspNet.SignalR
  27. 27. Some References
  28. 28. Routing is Very Important
  29. 29. Server Calling Client
  30. 30. Client Calling Server Function
  31. 31. DEMO