IoT with SignalR & .NET Gadgeteer

Slides:



Advertisements
Similar presentations
Overview Environment for Internet database connectivity
Advertisements

Microsoft Confidential. An incubation effort to: Support client -> server communication in native code with a modern C++ API design Support writing Azure-based.
Attie Naude 14 May 2013 Windows Azure Mobile Services.
Web Visualization Technology Horner APG Ver 1.0.
Nikola Dimitroff Creating Genres creatinggenres.com.
PHP/ASP Robert Nelson & Will Vanlue BA370 November 4 th, 2005.
Innovation Group Event: Cocktails & Clouds 10 th November 2011.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
Definitions, Definitions, Definitions Lead to Understanding.
Building Real Time Applications with ASP.NET SignalR 2.0
SignalR Real Time with SignalR Jared Rhodes Senior Consultant Magenic.
Basic SharePoint 2013 App Development start-up for New Developers
Intelligent Tutoring System Mobile Communication Team Drew Boatwright Nakul Dureja Richard Liou.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Kay Herzam Herzam IT Consulting What‘s new in ASP.NET MS TechTalk.
Cross Platform Mobile Backend with Mobile Services James
Lightning Talk Fred Rodriguez Aakash Juneja CPSC 473 March 16, 2012.
Web Servers Web server software is a product that works with the operating system The server computer can run more than one software product such as .
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
Exploring Real-time apps with ColdFusion and Blaze DS / Live Cycle Data Services ES Dan Blackman
.Net Remoting. 2 Distributed Computing under.Net In.Net, there are three levels of access to distributed computing machinery: In.Net, there are three.
ASP. Net is a rich web framework that leverages well known patterns and JavaScript frameworks to build great web experiences quickly.
Real Time Mobile Apps using Xamarin and SignalR
Reactive Extensions Ye olde introduction and walk-through, with plenty o’ code.
 You’re already a Web Site Dev  You’re interested in more simply making your web sites more responsive  If you’re not already hosting sites in.
Lecture 15 Introduction to Web Services Web Service Applications.
08 | What’s Next and Resources Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part.
IOS and Android with Windows Azure Websites Name Title Address Website.
NETWORK HARDWARE AND SOFTWARE MR ROSS UNIT 3 IT APPLICATIONS.
Progressive .NET Tutorials, July 3rd, London, UK
HTML5 AND THE FUTURE JAVASCRIPT PLATFORM Marcelo Lopez Ruiz Senior Software Design Engineer Microsoft Corporation.
ASP.NET SignalR SoftUni Team Technical Trainers Software University
Session Information Goals CTAs Customer Evidence TBD
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Tutorial 11 Solutions. Question 1 Q1. What is meant by interactivity for streaming stored audio/video? What is meant by interactivity for real-time interactive.
ASP.NET WEB Applications. ASP.NET  Web application framework developed by Microsoft  Build dynamic data driven web applications and web services  Subset.
Fall 2000C.Watters1 World Wide Web and E-Commerce Servers & Server Side Processing.
Windows Azure and iOS Chris Risner Windows Azure Technical Evangelist Microsoft
Keith Telle Lead Software Engineer Bit Wizards Behind the Magic: SignalR Demystified.
Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015.
APIs George Wyner January 28, Agenda What is an API? How do developers discover, understand, and use APIs to build applications How to use an API.
National College of Science & Information Technology.
Building Azure Mobile Apps
Research of Web Real-Time Communication Based on WebSocket
Introducing the Microsoft® .NET Framework
Build and Learn ASP.NET Workshop.
Jim Fawcett CSE775 – Distributed Objects Spring 2003
ChaRLeS: An Open-Source Chat Room Learning System
MeshCentral 2.0.
Section 6.3 Server-side Scripting
ASP.NET SignalR SoftUni Team C# MVC Frameworks Technical Trainers
6/4/2018 4:17 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS.
Building real-time web apps with WebSockets using IIS, ASP.NET and WCF
WebSocket: Full-Duplex Solution for the Web
SUPERCHARGE YOUR WEB APPLICATION WITH AZURE
Building real-time web apps with HTML5 WebSockets
The Application Lifecycle
.NET and .NET Core Foot View of .NET Pan Wuming 2017.
Hosted Web Apps with Windows App Studio
Nathan Totten Technical Evangelist Windows Azure
ASP.NET Module Subtitle.
What’s new in ASP.NET Core and Entity Framework 2.2 (Preview 3)
.NET Conf 2018 Keynote Jose Barbosa Aaron Amm Theeranit.
Jim Fawcett CSE791 – Distributed Objects Spring 2002
Part II Application Layer.
The Future is Now with ASP.NET Core 3.0
Running C# in the browser
Presentation transcript:

IoT with SignalR & .NET Gadgeteer Internet of Things & .NET Gadgeteer & Microsoft SignalR Mirco Vanini Microsoft® MVP Windows Embedded

Agenda Perché real-time e come ? SignalR Connections and Hubs Clients Demo Q&A Links

Perché real-time e come ? Gli utenti vogliono le ultime informazioni, ORA ! Twitter – live searches/updates Stock streamers Auctions Live scores Real-time notifications Interactive games Collaborative apps Live user analytics

Perché real-time e come ? HTTP is an old beast… Never designed for real-time communications Web is request-response Web is stateless HTML5 WebSockets to the rescue, right? Extension to HTTP Provide raw sockets over HTTP Full-duplex Traverses proxies It’s still a draft… Not every proxy server supports it Not every webserver supports it Not every browser supports it They are raw sockets!  

Perché real-time e come ? Come implementare il real-time con HTTP: Polling. Long Polling. Forever Frame. Server Sent Events

Perché real-time e come ? Polling: the stubborn approach Server Response Request Client delay Time: requests event ‘n’ seconds (fixed time) Twitter clients

Perché real-time e come ? Polling High overhead on requests: headers and such… High overhead on response: same as before… High latency. Waste of bandwith. Waste of resources.

Perché real-time e come ? Long Polling: the kind gentleman approach Server Response Request Client Variable delay Time: requests event ‘n’ seconds (variable) Facebook chat

Perché real-time e come ? Long Polling (Hanging GET) High overhead on requests: headers and such… High overhead on response: same as before… Medium latency. Waste less of bandwith. Waste of resources. Better than the previous one: less requests

Perché real-time e come ? Forever Frame Server HTTP/1.1 200 OK Content-Type: text/plain Transfer-Encoding: chunked Server tells client that response is chuncked Client keeps connection open untill server closes it Server pushes data to the client followed by \0 Consumes server threads <script>eval("... ")</script>\0 <script>eval("... ")</script>\0 Client

Perché real-time e come ? Server-Sent Events Server-Sent Events (SSE) are a standard describing how servers can initiate data transmission towards clients once an initial client connection has been established. They are commonly used to send message updates or continuous data streams to a browser client and designed to enhance native, cross-browser streaming through a JavaScript API called EventSource, through which a client requests a particular URL in order to receive an event stream. Stream Updates with Server-Sent Events

Real-time: How to survive ? So many options and a big Headache !

SignalR Persistent Connection Abstraction communication library. Abstracts protocol and transfer (choses the best one). A single programming model (a unified development experience). Extremely simple to use. Server-side it can be hosted in different «environments» (ASP.NET, console apps, windows services, etc…). Client-side there’s support for: Javascript clients, .NET clients, WP; provide by the community: iOS, Android.

Try WebSocket then fallback to: SignalR Works everywhere !!! Try WebSocket then fallback to: Server Sent Events Forever Frame Long Polling Bet to keep the logic connection up include retry logic Scale out to web-farms

SignalR Complete rewrite of the internals for 1.0.0 Very hight performance on a single box 100.000’s of messages per seconds Very low memory overhead Full async 1000’s of connection per server Cross-platform: run it on OSX or Linux with Mono Supported part of ASP.NET family

SignalR Persistent Connections: «Low level» API, manages the connection and the «raw» stream of data. Hubs: «High level» API, provide advanced support for internal routing (calling functions on server & clients), connection and disconnection tracking, grouping etc… Automatic client proxy generation (JavaScript)

SignalR Install-Package Microsoft.AspNet.SignalR Install-Package Microsoft.AspNet.SignalR.Sample

SignalR packages Core Meta package Hosts Microsoft.AspNet.SignalR.Core: Server side components needed to build SignalR endpoints Meta package Microsoft.AspNet.SignalR: - A meta package that brings in everything you need to run it on IIS and ASP.NET Hosts Microsoft.AspNet.SignalR.SystemWeb - Pulls in the required packages to host SignalR in ASP.NET (via OWIN ASP.NET host) Microsoft.AspNet.SignalR.Owin - OWIN* host for SignalR * OWIN stands for “Open Web Interface for .NET” and it is a specification for the communication between .NET Web Server and Web applications.

SignalR packages Clients Scaleout Buses Sample Microsoft.AspNet.SignalR.Js - Javascript client for SignalR Microsoft.AspNet.SignalR.Client - .NET client for SignalR (includes WinRT, Windows Phone 8 and Silverlight5 clients) Scaleout Buses Microsoft.AspNet.SignalR.Redis - Redis scaleout for SignalR Microsoft.AspNet.SignalR.ServiceBus - Service bus scaleout for SignalR Sample Microsoft.AspNet.SignalR.Sample - A sample stock ticker you can quickly and easily bring into your app to get a working sample up and running.

Demo Web Plant Monitor PlantHub PlantMonitor PlantManager Plant Device PlantCommand PlantData TcpCommandListener

Demo Data Flow HUB Device Page Page Page updatePlaintData SendCommand 21000 HUB data Device command 22000 command data updatePlaintData SendCommand Page Page Page

Q&A

Links Getting Started with ASP.NET SignalR ASP.NET SignalR Building Real-time Web Apps with ASP.NET SignalR Engaging the Realtime Web with SignalR SignalR. Code, not toothpaste.

Contatti Blog http://mircovanini.blogspot.com Email info@proxsoft.it Web www.proxsoft.it Twitter @MircoVanini