Building real-time web apps with WebSockets using IIS, ASP.NET and WCF

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Preface Demo A Quick Thank You How Did We Do It?
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
Building Scalable Web Apps with Windows Azure Name Title Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
demo Default WANGPSLookup Default WANGPS.
Feature: Payroll and HR Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Announcing Demo Announcing.
Feature: OLE Notes Migration Utility
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: SmartList Usability Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Connect with life Connect with life
Windows Azure Connect Name Title Microsoft Corporation.
demo Receive Inventory Export Parse and Normalize.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Suggested Item Enhancements – Sales Script and Additional Information © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows.
Building Social Games for Windows 8 with Windows Azure Name Title Microsoft Corporation.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Feature: Suggested Item Enhancements – Analysis and Assignment © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and.
Windows Azure SQL Data Sync Name Title Microsoft Corporation.
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

demo User Signs Up Temporary Account is Created with Verification Link Sent User Clicks Link Account is Activated Login.Register(userName,
Возможности Excel 2010, о которых следует знать
Making apps social and connected with HTTP services
HTML5 Platform from Web to Apps
Building real-time web apps with HTML5 WebSockets
Title of Presentation 11/22/2018 3:34 PM
Deep dive on app data roaming
Baseline: How Are We Doing Now?
Office Mac /30/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Title of Presentation 12/2/2018 3:48 PM
Build /2/2018 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
ASP.NET 4.5 loves HTML5, CSS3 & JavaScript
Create rich, data-driven Web apps with ASP.NET 4.5 Web Forms
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows 8 Security Internals
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
WINDOWS AZURE A LAP AROUND PLATFORM THE Steve Marx
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
The complete developer's guide to the SkyDrive API
ASP.NET Roadmap: One ASP.NET – Web Forms, MVC, Web API, and more
Title of Presentation 5/24/2019 1:26 PM
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
Erik Porter Program Manager ASP.NET Microsoft Corporation
Presentation transcript:

Building real-time web apps with WebSockets using IIS, ASP.NET and WCF 9/21/2018 12:00 AM SAC-807T Building real-time web apps with WebSockets using IIS, ASP.NET and WCF Paul Batum & Stefan Schackow Microsoft Corporation © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Agenda slide WebSockets is: Windows 8 developers Why WebSockets? WHO WILL BENEFIT FROM THIS TALK TOPICS WHAT YOU’LL LEAVE WITH Windows 8 developers Web developers Middle-tier developers Why WebSockets? Standardization & browser support Programming with WebSockets in ASP.NET and WCF WebSockets is: Securely enabling the real time web For the browser and beyond Use ASP.NET and WCF to develop WebSocket enabled websites and services

HTTP Limitations HTTP is a request-reply protocol Web applications today use workarounds to enable push

Current Programming Models Periodic Polling Server Client Polling interval Browser uses XmlHttpRequest to periodically query the server

Current Programming Models Long Polling Server Client Server holds on to the HTTP request until there is data to return Client sends a new request as soon as the previous request completes

Current Programming Models TechReady13 9/21/2018 Current Programming Models Periodic and long polling work everywhere However… Periodic polling is high latency Long polling programming model is unintuitive Many scale out issues Bandwidth overheads Limited cross domain support (JSONP) Can’t we just have the equivalent of a TCP socket? © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

WebSockets New interoperable technology, undergoing standardization Full duplex bidirectional socket W3C JavaScript API Secure (SSL) High performance Low latency Low bandwidth overhead Broad reach (port 80 & 443 by default) Cross-domain connections

Applications Rich web applications Real-time applications and services (stock tickers, monitoring systems, etc) Native connected applications (Windows 8, mobile, etc) Online games Business-to-business

WebSockets for: - Windows 8 - Internet Explorer 10 - .NET 4.5 <Conference/Group Name> 9/21/2018 12:00 AM announcing WebSockets for: - Windows 8 - Internet Explorer 10 - .NET 4.5 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

WebSockets in IE, Windows & .NET Implements hybi-10 IE 10 Windows 8 Runtime Client SDK IIS 8.0 .NET 4.5 (WebSocket features are Windows 8 only) ASP.NET WCF HttpListener

demo HTML5 WebSockets Game 9/21/2018 12:00 AM © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

WebSocket protocol: how it works Connection established using HTTP handshake Data is sent over the underlying TCP connection Binary or UTF8 Can traverse firewalls and proxies Best results when tunneled over SSL Load balancers TCP (L4)  HTTP (L7)  (enhancement required)

Standardization We are working closely with industry in the development of these standards Significant progress over the last 6 months Protocol spec beyond IETF last call W3C JavaScript API spec is still in draft but consensus is approaching Browser support IE 10 Chrome 14 Firefox 7 (namespaced)

Getting Started with WebSockets in ASP.NET & WCF 9/21/2018 12:00 AM demo Getting Started with WebSockets in ASP.NET & WCF © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Server Architecture Your code! WCF high level abstractions 9/21/2018 12:00 AM Server Architecture Your code! WCF high level abstractions WCF WebSocket transport ASP.NET high level abstractions System.Net.WebSockets ASP.NET HTTP Pipeline HttpListener IIS (iiswsock.dll) http.sys © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

WebSockets in WCF WebSocket transport for WCF Traditional WCF running over WebSocket connections <bindings> <netHttpBinding> <binding name="websocketBinding"> <webSocketSettings connectionMode="Required" pingFrequency="00:01:00" /> </binding> </netHttpBinding> </bindings>

ASP.NET low-level API Developer “agrees” to upgrade to a WebSocket connection HttpContext.Current.AcceptWebSocketRequest( Func<AspNetWebSocketContext,Task> myWebSocketApp, AspNetWebSocketOptions optionalSetupInfo ); Asynchronously receive and send messages public async Task MyWebSocketApp(AspNetWebSocketContext context) { var socket = context.WebSocket; … var input = await socket.ReceiveAsync(buffer); await socket.SendAsync(outputBuffer,…params…); }

High-level Programming Abstractions Simplified WebSockets “handler” Low level buffer management and socket state management Buffers and queues outbound messages Automatically coalesces received messages Exposes state machine as simple method overrides WCF and ASP.NET APIs designed to be very similar © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

ASP.NET SignalR Library 9/21/2018 12:00 AM ASP.NET SignalR Library Abstracts away the concept of a socket Includes both server-side WebSocket support and a client-side Javascript library Bridge to older non-HTML 5 clients with support for HTTP long-polling Two SignalR coding approaches: PersistentConnection message-oriented approach Hubs RPC-style approach © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

demo SignalR: Chat 9/21/2018 12:00 AM © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

SignalR Hubs: Shape Share 9/21/2018 12:00 AM demo SignalR Hubs: Shape Share © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

WebSockets is: Securely enabling the real time web

WebSockets is: For the browser and beyond

Use ASP.NET and WCF to develop WebSocket enabled websites and services

For more information CONTACT: pbatum@microsoft.com RELATED SESSIONS SAC-798T Building Web APIs in Windows Azure with WCF to reach any device PLAT-580T Building Windows runtime sockets apps SAC-804T Building IIS and ASP.NET apps with the power of async PLAT-373C Building real-time web apps with HTML5 WebSockets CONTACT: pbatum@microsoft.com stefsch@microsoft.com

thank you Feedback and questions http://forums.dev.windows.com Session feedback http://bldw.in/SessionFeedback

9/21/2018 12:00 AM © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.