Realtime web open house

951 views

Published on

SirnalR talk at Sela open house

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
951
On SlideShare
0
From Embeds
0
Number of Embeds
304
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Realtime web open house

  1. 1. © Copyright SELA software & Education Labs Ltd. 14-18 Baruch Hirsch St.Bnei Brak 51202 Israel www.sela.co.il
  2. 2. What is “Real Time” experience “Real Time” web techniques What is signalR SignalR protocol Connection & Hub Groups and private messages .Net client Self Hosting Scaleout
  3. 3. Polling ForeverFrames Long-Polling ServerSentEvents WebSocket
  4. 4. Web Socket Request TCP Socket ServerClient
  5. 5. • Not all servers support web sockets • Not all network components support web sockets • Its API is limited
  6. 6. • Code once, deploy everywhere • As cross-platform as possible • Simple API to work with
  7. 7. • Open source project • Abstraction layer over connection technique • Can be self-hosted • Call client methods from the server Polling ForeverFrames Long-Polling ServerSentEvents WebSocket =
  8. 8. WebSocket • Good performance • Strict prerequisites • Limited API SignalR • Abstraction layer • Rich API • Supports WebSocket
  9. 9. Negotiate request Negotiate response Connection phase Client Server
  10. 10. • WebSocket-like API • Lower level code • Provides us with more control
  11. 11. • Abstraction over signalR connection • Service-like API • Call clients methods from the server
  12. 12. • You can use connection ID • You can access a particular client by it Clients.Client(connectionId).sendMessage(message)
  13. 13. • Part of Hub API • Stored on client • Not persistent
  14. 14. _connection = new HubConnection("http://localhost/RanWahle.Blog.SignalR.Demo"); IHubProxy proxy = connection.CreateHubProxy("soccerResultsHub"); _connection.Start().ContinueWith( //define proxies ); //invoke server methods _proxy.Invoke(“HubServerMethod“ , args…));
  15. 15. • Three NuGet packages to install • Create class with Configuration method. • Map hub in the Configuration method • Use the class as a type parameter to WebApplication.Start
  16. 16. • signalR supports ASP.NET authentication & authorization • AuthorizeAttribute • Accessing user data from context • Authenticated request may downdgrade to serverSentEvents in some clients.
  17. 17. • Install Microsoft.AspNet.SignalR.SqlServer nuget • Add One line of code • Your app is ready to scaleout
  18. 18. Real time experience is more than just polling Using signalR can use the best available technique It can be self hosted It can scale out It has several clients
  19. 19. • http://www.asp.net/signalr • http://signalr.net/ • Twitters:@signalr @DamianEdwards @davidfowl and @DavianFowlwards • http://blogs.Microsoft.co.il/blogs/ranw
  20. 20. © Copyright SELA software & Education Labs Ltd. 14-18 Baruch Hirsch St.Bnei Brak 51202 Israel www.sela.co.il

×