Connected Web Systems

534 views

Published on

Connecting Web Systems by Damir Dobric. Presentation from the Advanced Developers Conference

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
534
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Connected Web Systems

  1. 1. Connecting Web SystemsLap around new technologies which might change the websoon. by Damir Dobric
  2. 2. AGENDA Request Persistent Long Polling Response ConnectionsLimits of Web Connecting Polling Streaming Patterns Async in Stream Push toData ASP.NET 4.5 Backend BrowserStreaming inWeb Long HttpTaskAsync Stream Push to Responses Handler any app JS WebSocket WCF WebSocket HTML5 Spec. Client ServiceWeb Sockets IIS8-WebSocket ASP.NET Web WCF WebSocket Support Socket Server Client Persistent ForeverFrames JS Client Connections Signal R SentServerEvents .NET Server Hubs
  3. 3. Limits of Webhttp Request/Response X
  4. 4. Connecting Patterns http Request/Response X http Request/Response http polling http Request/Response Full-Duplex
  5. 5. Polling Approachwhile(true){ var response = httpClient.SendRequest(“http://...”); processResponse(response.Data); Thread.Sleep(T);} tcpClient.TimeOut = 999999..; var netStream = tcpClient.SendHttpRequest(“http://...”); while(true){ var data1 = netStream.Read(); var data2 = processData(data1); netStream.Write(data2); } }
  6. 6. Infrastructure LimitsFull-Duplex No streaming support ? X Connection Limit ? X
  7. 7. DATA STREAMING IN WEB Async in Stream Push toASP.NET 4.5 Backend Browser Long HttpTaskAsync Stream Push toResponses Handler any app
  8. 8. Why Async ?o Async In Front End o Responsive UI o Battery Lifeo Async in Backend o Waiting on IO o Fan Out Await o C/S Stream
  9. 9. DEMO Async in Stream Push toASP.NET 4.5 Backend Browser Long HttpTaskAsync Stream Push toResponses Handler any app
  10. 10. WEB SOCKETS JS WebSocket WCF WebSocket HTML5 Spec. Client ServiceIIS8-WebSocket ASP.NET Web WCF WebSocket Support Socket Server Client
  11. 11. What is WebSocket?o Driven by HTML5o Full-Duplex over TCPo Browser native Socket connectiono IETF Spec. - HyBi 17(IE10 Win8=HyBi10)
  12. 12. ArchitectureEndpoints WinRT .NETJavaScript WebSockets Consumers JavaScript WCF WinRTASP.NET WebSocket .NETModule Hosting Consumers WCF netHttp Duplex
  13. 13. WebSocket SequenceDevelopers.dehttp://developers.de/blogs/damir_dobric/archive/2012/01/29/websockets-in-asp-net-and-javascript.aspx
  14. 14. DEMO WebSocket WebSocketHTTP/Upgrade Chat WCF Duplex ASP.NET WebSocket NetHttp JavaScript Hanlder
  15. 15. References• http://developers.de/blogs/damir_dobric/archive/2011/11/26/wcf-duplex-via-websocket.aspx• http://rickgaribay.net/archive/2012/08/14/the-goods-websockets-programming-in-.net-4.5-and- windows-azure.aspx• http://www.devconnections.com/updates/Garibay_Build%20Speedy%20Azure%20Applications%20 with%20HTML5%20and%20Web%20Sockets%20Today.pdf• http://rickgaribay.net/archive/2012/08/14/the-goods-websockets-programming-in-.net-4.5-and- windows-azure.aspx• http://www.paulbatum.com/2011/10/getting-to-know-systemnetwebsockets.html
  16. 16. SignalR Persistent ForeverFrames JS Client ConnectionsSentServerEvents .NET Server Hubs
  17. 17. What when?No ClientWebSocketSupport ? X No Server No streaming support ? X WebSocket Support ?
  18. 18. Server Sent Events• Push from a server to a browser• Part of HTML5 spec• http://dev.w3.org/html5/eventsource• Header: text/event-stream• Implemented natively in Browser• Long polling without closing connectionhttp://dsheiko.com/weblog/websockets-vs-sse-vs-long-polling
  19. 19. Forever-Frame streamingo Push notificationso Not based on Long-Pollingo Uses HTTP 1.1 chunked encodingo Internet Explorer
  20. 20. SignalRo Permanent Connection support for none HTML5 browsers.o Use it when infrastructure does not support any other push technologyo Two Part Library o jQuery PlugIn for Client o .NET Library for Servero Supported Transports: o Long polling o WebSockets o Forever Frame streaming o Server Sent events
  21. 21. DEMO Persistent ForeverFrames JS Client ConnectionsSentServerEvents .NET Server Hubs
  22. 22. References• https://github.com/SignalR/SignalR• http://www.hanselman.com/blog/AsynchronousScalableWebApplicationsWithRealtimePersistentLon grunningConnectionsWithSignalR.aspx• http://www.hanselman.com/blog/CloudControlledRemotePanTiltZoomCameraAPIForALogitechBCC9 50CameraWithAzureAndSignalR.aspx
  23. 23. RECAP + Q&A Request Persistent Long Polling Response ConnectionsLimits of Web Connecting Polling Streaming Patterns Async in Stream Push toData ASP.NET 4.5 Backend BrowserStreaming inWeb Long HttpTaskAsync Stream Push to Responses Handler any app JS WebSocket WCF WebSocket HTML5 Spec. Client ServiceWeb Sockets IIS8-WebSocket ASP.NET Web WCF WebSocket Support Socket Server Client Persistent ForeverFrames JS Client Connections Signal R SentServerEvents .NET Server Hubs
  24. 24. Thank You  Damir Dobric

×