SlideShare uma empresa Scribd logo
1 de 26
NetMF@Work
NetMF@Work
IoT with SignalR & .NET Gadgeteer
Mirco Vanini
http://mircovanini.blogspot.com
info@proxsoft.it
@MircoVanini
Microsoft MVP Windows Embedded
NetMF@WorkGrazie agli sponsor
NetMF@Work
Perché real-time e come ?
SignalR
Connections and Hubs
Clients
Demo
Q&A
Links
Agenda
NetMF@Work
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 ?
NetMF@Work
HTTP is an old beast…
Never designed for real-time communications
Web is request-response
Web is stateless
HTML5 WebSockets to the rescue, right?
Perché real-time e come ?
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!
 
NetMF@Work
Come implementare il real-time con HTTP:
• Polling.
• Long Polling.
• Forever Frame.
• Server Sent Events
Perché real-time e come ?
NetMF@WorkPerché real-time e come ?
Polling: the stubborn approach
Server
Client
Time: requests event ‘n’ seconds (fixed time)
Request
Response
delay
Twitter clients
NetMF@Work
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 ?
NetMF@WorkPerché real-time e come ?
Long Polling: the kind gentleman approach
Server
Client
Time: requests event ‘n’ seconds (variable)
Request
Response
Variable delay
Facebook chat
NetMF@Work
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 ?
NetMF@WorkPerché real-time e come ?
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
Forever Frame
NetMF@Work
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
Perché real-time e come ?
NetMF@Work
So many options and a big Headache !
Real-time: How to survive ?
NetMF@Work
• 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.
SignalR
NetMF@Work
• 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
NetMF@Work
• 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
NetMF@Work
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
NetMF@WorkSignalR
Install-Package Microsoft.AspNet.SignalR –pre
Install-Package Microsoft.AspNet.SignalR.Sample -
pre
NetMF@Work
Core
• 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
NetMF@Work
Clients
• 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.
SignalR packages
NetMF@Work
Web Plant Monitor
PlantHub
PlantMonitor
PlantManager
Plant Device
PlantCommand
PlantData
TcpCommandListener
Demo
NetMF@Work
Page
Page
Schema
HUB Device
Page
SendCommand
data
command
22000
21000
data
updatePlaintData
command
NetMF@WorkQ&A
NetMF@Work
ASP.NET SignalR
Building Real-time Web Apps with ASP.NET SignalR
Engaging the Realtime Web with SignalR
SignalR. Code, not toothpaste.
Links
NetMF@WorkGrazie agli sponsor
NetMF@WorkFeedback Form
Per voi sono solo 10 minuti persi, per
noi è utilissimo per poter crescere!!!!
http://tinyurl.com/netmfwork

Mais conteúdo relacionado

Mais procurados

Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)
Deepak Gupta
 
SignalR. Code, not toothpaste - TechDays Belgium 2012
SignalR. Code, not toothpaste - TechDays Belgium 2012SignalR. Code, not toothpaste - TechDays Belgium 2012
SignalR. Code, not toothpaste - TechDays Belgium 2012
Maarten Balliauw
 

Mais procurados (20)

Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
 
SignalR
SignalRSignalR
SignalR
 
SignalR with asp.net
SignalR with asp.netSignalR with asp.net
SignalR with asp.net
 
Intro to signalR
Intro to signalRIntro to signalR
Intro to signalR
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
 
SignalR Overview
SignalR OverviewSignalR Overview
SignalR Overview
 
Real-time ASP.NET with SignalR
Real-time ASP.NET with SignalRReal-time ASP.NET with SignalR
Real-time ASP.NET with SignalR
 
Real time web with SignalR
Real time web with SignalRReal time web with SignalR
Real time web with SignalR
 
Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)
 
Signal R 2015
Signal R 2015Signal R 2015
Signal R 2015
 
Signalr with ASP.Net part2
Signalr with ASP.Net part2Signalr with ASP.Net part2
Signalr with ASP.Net part2
 
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
 
Evolution / History of ASP.NET
Evolution / History of ASP.NETEvolution / History of ASP.NET
Evolution / History of ASP.NET
 
APIdays Paris 2018 - Secure & Manage APIs with GraphQL, Ozair Sheikh, Directo...
APIdays Paris 2018 - Secure & Manage APIs with GraphQL, Ozair Sheikh, Directo...APIdays Paris 2018 - Secure & Manage APIs with GraphQL, Ozair Sheikh, Directo...
APIdays Paris 2018 - Secure & Manage APIs with GraphQL, Ozair Sheikh, Directo...
 
Scale your signalR realtime web application
Scale your signalR realtime web applicationScale your signalR realtime web application
Scale your signalR realtime web application
 
SignalR. Code, not toothpaste - TechDays Belgium 2012
SignalR. Code, not toothpaste - TechDays Belgium 2012SignalR. Code, not toothpaste - TechDays Belgium 2012
SignalR. Code, not toothpaste - TechDays Belgium 2012
 
Engage 2020: Hello are you listening, There is stream for everything
Engage 2020: Hello are you listening, There is stream for everythingEngage 2020: Hello are you listening, There is stream for everything
Engage 2020: Hello are you listening, There is stream for everything
 
SignalR
SignalRSignalR
SignalR
 
Developing Resilient Cloud Native Apps with Spring Cloud
Developing Resilient Cloud Native Apps with Spring CloudDeveloping Resilient Cloud Native Apps with Spring Cloud
Developing Resilient Cloud Native Apps with Spring Cloud
 
Real Time UI with Apache Kafka Streaming Analytics of Fast Data and Server Push
Real Time UI with Apache Kafka Streaming Analytics of Fast Data and Server PushReal Time UI with Apache Kafka Streaming Analytics of Fast Data and Server Push
Real Time UI with Apache Kafka Streaming Analytics of Fast Data and Server Push
 

Semelhante a IoT with SignalR & .NET Gadgeteer - NetMF@Work

Asynchronous Mobile Web Services:
Asynchronous Mobile Web Services: Asynchronous Mobile Web Services:
Asynchronous Mobile Web Services:
Dr. Fahad Aijaz
 
AMF Flash and .NET
AMF Flash and .NETAMF Flash and .NET
AMF Flash and .NET
Yaniv Uriel
 
Internetandjava
InternetandjavaInternetandjava
Internetandjava
muniinb4u
 
JavaInternetlearning
JavaInternetlearningJavaInternetlearning
JavaInternetlearning
muniinb4u
 
Internetandjava
InternetandjavaInternetandjava
Internetandjava
muniinb4u
 
Javauserguide
JavauserguideJavauserguide
Javauserguide
muniinb4u
 

Semelhante a IoT with SignalR & .NET Gadgeteer - NetMF@Work (20)

SignalR 101
SignalR 101SignalR 101
SignalR 101
 
SignalR
SignalR SignalR
SignalR
 
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.jsAsynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
 
Web e device in real time con asp.net Signal R
Web e device in real time con asp.net Signal RWeb e device in real time con asp.net Signal R
Web e device in real time con asp.net Signal R
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
 
Overview of SignalR
Overview of SignalROverview of SignalR
Overview of SignalR
 
Asynchronous Mobile Web Services:
Asynchronous Mobile Web Services: Asynchronous Mobile Web Services:
Asynchronous Mobile Web Services:
 
Building Real time Application with Azure SignalR Service
Building Real time Application with Azure SignalR ServiceBuilding Real time Application with Azure SignalR Service
Building Real time Application with Azure SignalR Service
 
AMF Flash and .NET
AMF Flash and .NETAMF Flash and .NET
AMF Flash and .NET
 
Internetandjava
InternetandjavaInternetandjava
Internetandjava
 
ppttips
ppttipsppttips
ppttips
 
ppttips
ppttipsppttips
ppttips
 
Java
JavaJava
Java
 
ppttips
ppttipsppttips
ppttips
 
JavaInternetlearning
JavaInternetlearningJavaInternetlearning
JavaInternetlearning
 
ppt tips
ppt tipsppt tips
ppt tips
 
ppttips
ppttipsppttips
ppttips
 
Internetandjava
InternetandjavaInternetandjava
Internetandjava
 
Javauserguide
JavauserguideJavauserguide
Javauserguide
 
Cs2305 nol
Cs2305 nolCs2305 nol
Cs2305 nol
 

Mais de Mirco Vanini

Mais de Mirco Vanini (20)

.NET 7 Performance Improvements_10_03_2023.pdf
.NET 7 Performance Improvements_10_03_2023.pdf.NET 7 Performance Improvements_10_03_2023.pdf
.NET 7 Performance Improvements_10_03_2023.pdf
 
Debugging a .NET program after crash (Post-mortem debugging)
Debugging a .NET program after crash (Post-mortem debugging)Debugging a .NET program after crash (Post-mortem debugging)
Debugging a .NET program after crash (Post-mortem debugging)
 
Connect a chips to Azure
Connect a chips to AzureConnect a chips to Azure
Connect a chips to Azure
 
Connect a chips to Azure
Connect a chips to AzureConnect a chips to Azure
Connect a chips to Azure
 
How to modernise WPF and Windows Forms applications with Windows Apps SDK
How to modernise WPF and Windows Forms applications with Windows Apps SDKHow to modernise WPF and Windows Forms applications with Windows Apps SDK
How to modernise WPF and Windows Forms applications with Windows Apps SDK
 
C# on a CHIPs
C# on a CHIPsC# on a CHIPs
C# on a CHIPs
 
.NET Conf 2021 - Hot Topics Desktop Development
.NET Conf 2021 - Hot Topics Desktop Development.NET Conf 2021 - Hot Topics Desktop Development
.NET Conf 2021 - Hot Topics Desktop Development
 
Async Debugging A Practical Guide to survive !
Async Debugging A Practical Guide to survive !Async Debugging A Practical Guide to survive !
Async Debugging A Practical Guide to survive !
 
IoT support for .NET (Core/5/6)
IoT support for .NET (Core/5/6)IoT support for .NET (Core/5/6)
IoT support for .NET (Core/5/6)
 
Async Debugging - A Practical Guide to survive !
Async Debugging - A Practical Guide to survive !Async Debugging - A Practical Guide to survive !
Async Debugging - A Practical Guide to survive !
 
IoT support for .NET Core
IoT support for .NET CoreIoT support for .NET Core
IoT support for .NET Core
 
IoT support for .NET Core - IoT Saturday 2020
IoT support for .NET Core - IoT Saturday 2020IoT support for .NET Core - IoT Saturday 2020
IoT support for .NET Core - IoT Saturday 2020
 
.NET Conf 2020 - Hot Topics Desktop Development
.NET Conf 2020 - Hot Topics Desktop Development.NET Conf 2020 - Hot Topics Desktop Development
.NET Conf 2020 - Hot Topics Desktop Development
 
Are you ready for Microsoft Azure Sphere?
Are you ready for Microsoft Azure Sphere?Are you ready for Microsoft Azure Sphere?
Are you ready for Microsoft Azure Sphere?
 
IoT Day 2019 Naples - Microsoft Azure Shpere
IoT Day 2019 Naples - Microsoft Azure ShpereIoT Day 2019 Naples - Microsoft Azure Shpere
IoT Day 2019 Naples - Microsoft Azure Shpere
 
Debugging with VS2019
Debugging with VS2019Debugging with VS2019
Debugging with VS2019
 
Azure Sphere
Azure SphereAzure Sphere
Azure Sphere
 
Optimising code using Span<T>
Optimising code using Span<T>Optimising code using Span<T>
Optimising code using Span<T>
 
Azure Sphere
Azure SphereAzure Sphere
Azure Sphere
 
Xe OneDay - Modernizing Enterprise Apps
Xe OneDay - Modernizing Enterprise AppsXe OneDay - Modernizing Enterprise Apps
Xe OneDay - Modernizing Enterprise Apps
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

IoT with SignalR & .NET Gadgeteer - NetMF@Work

  • 1. NetMF@Work NetMF@Work IoT with SignalR & .NET Gadgeteer Mirco Vanini http://mircovanini.blogspot.com info@proxsoft.it @MircoVanini Microsoft MVP Windows Embedded
  • 3. NetMF@Work Perché real-time e come ? SignalR Connections and Hubs Clients Demo Q&A Links Agenda
  • 4. NetMF@Work 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 ?
  • 5. NetMF@Work HTTP is an old beast… Never designed for real-time communications Web is request-response Web is stateless HTML5 WebSockets to the rescue, right? Perché real-time e come ? 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!  
  • 6. NetMF@Work Come implementare il real-time con HTTP: • Polling. • Long Polling. • Forever Frame. • Server Sent Events Perché real-time e come ?
  • 7. NetMF@WorkPerché real-time e come ? Polling: the stubborn approach Server Client Time: requests event ‘n’ seconds (fixed time) Request Response delay Twitter clients
  • 8. NetMF@Work 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 ?
  • 9. NetMF@WorkPerché real-time e come ? Long Polling: the kind gentleman approach Server Client Time: requests event ‘n’ seconds (variable) Request Response Variable delay Facebook chat
  • 10. NetMF@Work 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 ?
  • 11. NetMF@WorkPerché real-time e come ? 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 Forever Frame
  • 12. NetMF@Work 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 Perché real-time e come ?
  • 13. NetMF@Work So many options and a big Headache ! Real-time: How to survive ?
  • 14. NetMF@Work • 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. SignalR
  • 15. NetMF@Work • 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
  • 16. NetMF@Work • 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
  • 17. NetMF@Work 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
  • 19. NetMF@Work Core • 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
  • 20. NetMF@Work Clients • 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. SignalR packages
  • 21. NetMF@Work Web Plant Monitor PlantHub PlantMonitor PlantManager Plant Device PlantCommand PlantData TcpCommandListener Demo
  • 24. NetMF@Work ASP.NET SignalR Building Real-time Web Apps with ASP.NET SignalR Engaging the Realtime Web with SignalR SignalR. Code, not toothpaste. Links
  • 26. NetMF@WorkFeedback Form Per voi sono solo 10 minuti persi, per noi è utilissimo per poter crescere!!!! http://tinyurl.com/netmfwork