SlideShare una empresa de Scribd logo
1 de 22
SignalR: Add real-time to your
applications
by Eugene Zharkov
Why to use SignalR?
https://github.com/SignalR/SignalR
2
Transports
• WebSockets (the only true full-duplex)
• Server Sent Events
• Forever Frame
• Long polling
WebSockets
• html5 feature
• works on top of TCP protocol
• full-duplex
• low latency, low overhead
• you need >IE10 and IIS8
• not all browsers / servers/ proxies support it
Server Sent Events
• requires a single connection between client-server
• uses JS API EventSource through which client can request a particular
URL to receive data stream
• no need to reconnect
• works in server-2-client direction only
Forever Frames
• only for IE
• hidden iframes are in the load loop with chunks of data
6
Long Polling
• high overhead on requests/response (headers etc.)
• medium latency
7
Transports
8
Clients
• iOS (SignalR-ObjC)
• Android (SignalA)
• Windows RT / Phone
• jQuery, Backbone
• Mono
• QT (SignalR-QT)
9
Requirements
• Windows Server 2008 R2/2012, Windows 7/8
• IIS 8. IIS 7 and 7.5. Support for extensionless URLs is required.
• >= .NET 3.5, WinRT, Silverlight
10
Does NOT support IE 6/7
11
Persistent Connection
• the raw connection
• IHTTP handler (OnConnection, OnDisconnection, OnReconnection)
• custom logic must be implemented
12
Hub
• high-level API on top of Persistent Connection
• route automatically mapped
• clients can be divided by groups
13
Add to project
14
New References and Scripts
15
Hub registration : C#
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
RouteTable.Routes.MapHubs();
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configurat
FilterConfig.RegisterGlobalFilters(GlobalFilters.Fil
01.
02.
03.
04.
05.
06.
07.
08.
16
Hub object | C#
public class Documents : Hub
{
public void Send(string documentName)
{
Clients.All.addMessage(documentName);
}
}
01.
02.
03.
04.
05.
06.
07.
17
Subscribe to Hub messages | JS
var documentHub = $.connection.documents;
documentHub.client.addMessage = function (documentName) {
$("#documents").append("<li>" + documentName + "</li>");
};
01.
02.
03.
04.
18
Hub object | JS
$.connection.hub.logging = true;
$.connection.hub.start().done(function () {
$("#addDocument").click(function () {
documentHub.server.send($("#document").val());
});
});
01.
02.
03.
04.
05.
06.
19
Working with Hub | WinRT
var connection = new HubConnection("http://localhost:59576");
var hub = connection.CreateHubProxy("documents");
hub.On("addMessage", message =>
Dispatcher.RunAsync(CoreDispatcherPriority.Normal,() =>
{
DocumentsCounter.Text = (++_newDocuments).ToString();
}));
01.
02.
03.
04.
05.
06.
07.
20
Working with Hub | Android (SignalA)
HubConnection con = new HubConnection("http://localhost:59576
this, new LongPollingTransport())
IHubProxy hub = con.CreateHubProxy("documents");
hub.On("addMessage", new HubOnDataCallback() {
@Override
public void OnReceived(.. args) {
{ //... }});
con.Start();
01.
02.
03.
04.
05.
06.
07.
21
That's all folks
• @2j2e
• eu.zharkov@gmail.com
• http://bit.ly/signalr0
22

Más contenido relacionado

La actualidad más candente

[Webinar] AWS Monitoring with Site24x7
[Webinar] AWS Monitoring with Site24x7[Webinar] AWS Monitoring with Site24x7
[Webinar] AWS Monitoring with Site24x7Site24x7
 
Manage your APIs and Microservices with an API Gateway
Manage your APIs and Microservices with an API GatewayManage your APIs and Microservices with an API Gateway
Manage your APIs and Microservices with an API GatewayThibault Charbonnier
 
Build your First IoT Application with IBM Watson IoT
Build your First IoT Application with IBM Watson IoTBuild your First IoT Application with IBM Watson IoT
Build your First IoT Application with IBM Watson IoTJanakiram MSV
 
Site24x7 Cloud Monitoring
Site24x7 Cloud MonitoringSite24x7 Cloud Monitoring
Site24x7 Cloud MonitoringSite24x7
 
SignalR With ASP.Net part1
SignalR With ASP.Net part1SignalR With ASP.Net part1
SignalR With ASP.Net part1Esraa Ammar
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalRAdam Mokan
 
Building Realtime Web Applications With ASP.NET SignalR
Building Realtime Web Applications With ASP.NET SignalRBuilding Realtime Web Applications With ASP.NET SignalR
Building Realtime Web Applications With ASP.NET SignalRShravan Kumar Kasagoni
 
Expose BizTalk to the world (ACSUG)
Expose BizTalk to the world (ACSUG)Expose BizTalk to the world (ACSUG)
Expose BizTalk to the world (ACSUG)Wagner Silveira
 
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...BIOVIA
 
OSMC 2021 | Advanced MySQL optimization and troubleshooting using PMM 2
OSMC 2021 | Advanced MySQL optimization and troubleshooting using PMM 2OSMC 2021 | Advanced MySQL optimization and troubleshooting using PMM 2
OSMC 2021 | Advanced MySQL optimization and troubleshooting using PMM 2NETWAYS
 
Real User Monitoring (RUM)
Real User Monitoring (RUM)Real User Monitoring (RUM)
Real User Monitoring (RUM)Site24x7
 

La actualidad más candente (20)

[Webinar] AWS Monitoring with Site24x7
[Webinar] AWS Monitoring with Site24x7[Webinar] AWS Monitoring with Site24x7
[Webinar] AWS Monitoring with Site24x7
 
Containerize!
Containerize!Containerize!
Containerize!
 
Manage your APIs and Microservices with an API Gateway
Manage your APIs and Microservices with an API GatewayManage your APIs and Microservices with an API Gateway
Manage your APIs and Microservices with an API Gateway
 
SignalR with asp.net
SignalR with asp.netSignalR with asp.net
SignalR with asp.net
 
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
 
Build your First IoT Application with IBM Watson IoT
Build your First IoT Application with IBM Watson IoTBuild your First IoT Application with IBM Watson IoT
Build your First IoT Application with IBM Watson IoT
 
Site24x7 Cloud Monitoring
Site24x7 Cloud MonitoringSite24x7 Cloud Monitoring
Site24x7 Cloud Monitoring
 
SignalR With ASP.Net part1
SignalR With ASP.Net part1SignalR With ASP.Net part1
SignalR With ASP.Net part1
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
 
Building Realtime Web Applications With ASP.NET SignalR
Building Realtime Web Applications With ASP.NET SignalRBuilding Realtime Web Applications With ASP.NET SignalR
Building Realtime Web Applications With ASP.NET SignalR
 
Expose BizTalk to the world (ACSUG)
Expose BizTalk to the world (ACSUG)Expose BizTalk to the world (ACSUG)
Expose BizTalk to the world (ACSUG)
 
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
 
Intro to signalR
Intro to signalRIntro to signalR
Intro to signalR
 
SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6
 
SignalR
SignalRSignalR
SignalR
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
 
OSMC 2021 | Advanced MySQL optimization and troubleshooting using PMM 2
OSMC 2021 | Advanced MySQL optimization and troubleshooting using PMM 2OSMC 2021 | Advanced MySQL optimization and troubleshooting using PMM 2
OSMC 2021 | Advanced MySQL optimization and troubleshooting using PMM 2
 
Flux and React.js
Flux and React.jsFlux and React.js
Flux and React.js
 
Real User Monitoring (RUM)
Real User Monitoring (RUM)Real User Monitoring (RUM)
Real User Monitoring (RUM)
 

Similar a SignalR: Add real-time to your applications

.NET Conf 2022 - Networking in .NET 7
.NET Conf 2022 - Networking in .NET 7.NET Conf 2022 - Networking in .NET 7
.NET Conf 2022 - Networking in .NET 7Karel Zikmund
 
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
 
Top 10 HTML5 Features for Oracle Cloud Developers
Top 10 HTML5 Features for Oracle Cloud DevelopersTop 10 HTML5 Features for Oracle Cloud Developers
Top 10 HTML5 Features for Oracle Cloud DevelopersBrian Huff
 
Developing Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax PushDeveloping Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax PushDoris Chen
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Arun Gupta
 
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsys
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsysUsing communication and messaging API in the HTML5 world - GIl Fink, sparXsys
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsysCodemotion Tel Aviv
 
Brushing skills on SignalR for ASP.NET developers
Brushing skills on SignalR for ASP.NET developersBrushing skills on SignalR for ASP.NET developers
Brushing skills on SignalR for ASP.NET developersONE BCG
 
ASP.NET MVC 5 and SignalR 2
ASP.NET MVC 5 and SignalR 2ASP.NET MVC 5 and SignalR 2
ASP.NET MVC 5 and SignalR 2Jaliya Udagedara
 
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel ZikmundWUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel ZikmundKarel Zikmund
 
Real-time web applications using SharePoint, SignalR and Azure Service Bus
Real-time web applications using SharePoint, SignalR and Azure Service BusReal-time web applications using SharePoint, SignalR and Azure Service Bus
Real-time web applications using SharePoint, SignalR and Azure Service BusDinusha Kumarasiri
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5Malam Team
 
.NET Core Today and Tomorrow
.NET Core Today and Tomorrow.NET Core Today and Tomorrow
.NET Core Today and TomorrowJon Galloway
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationStuart (Pid) Williams
 
MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelAlex Thissen
 
Fancy Features in Asp.Net Core SignalR
Fancy Features in Asp.Net Core SignalRFancy Features in Asp.Net Core SignalR
Fancy Features in Asp.Net Core SignalRVladimir Georgiev
 
Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescueMarko Heijnen
 
Adding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded SystemAdding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded SystemJohn Efstathiades
 
APIs, STOP Polling, lets go Streaming
APIs, STOP Polling, lets go StreamingAPIs, STOP Polling, lets go Streaming
APIs, STOP Polling, lets go StreamingPhil Wilkins
 

Similar a SignalR: Add real-time to your applications (20)

.NET Conf 2022 - Networking in .NET 7
.NET Conf 2022 - Networking in .NET 7.NET Conf 2022 - Networking in .NET 7
.NET Conf 2022 - Networking in .NET 7
 
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)
 
Top 10 HTML5 Features for Oracle Cloud Developers
Top 10 HTML5 Features for Oracle Cloud DevelopersTop 10 HTML5 Features for Oracle Cloud Developers
Top 10 HTML5 Features for Oracle Cloud Developers
 
Developing Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax PushDeveloping Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax Push
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
 
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsys
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsysUsing communication and messaging API in the HTML5 world - GIl Fink, sparXsys
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsys
 
Brushing skills on SignalR for ASP.NET developers
Brushing skills on SignalR for ASP.NET developersBrushing skills on SignalR for ASP.NET developers
Brushing skills on SignalR for ASP.NET developers
 
ASP.NET MVC 5 and SignalR 2
ASP.NET MVC 5 and SignalR 2ASP.NET MVC 5 and SignalR 2
ASP.NET MVC 5 and SignalR 2
 
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel ZikmundWUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
 
Real-time web applications using SharePoint, SignalR and Azure Service Bus
Real-time web applications using SharePoint, SignalR and Azure Service BusReal-time web applications using SharePoint, SignalR and Azure Service Bus
Real-time web applications using SharePoint, SignalR and Azure Service Bus
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5
 
.NET Core Today and Tomorrow
.NET Core Today and Tomorrow.NET Core Today and Tomorrow
.NET Core Today and Tomorrow
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming model
 
Fancy Features in Asp.Net Core SignalR
Fancy Features in Asp.Net Core SignalRFancy Features in Asp.Net Core SignalR
Fancy Features in Asp.Net Core SignalR
 
Philly Tech Fest Iis
Philly Tech Fest IisPhilly Tech Fest Iis
Philly Tech Fest Iis
 
Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescue
 
Adding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded SystemAdding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded System
 
APIs, STOP Polling, lets go Streaming
APIs, STOP Polling, lets go StreamingAPIs, STOP Polling, lets go Streaming
APIs, STOP Polling, lets go Streaming
 

Más de Eugene Zharkov

Monorepo: React + React Native. React Alicante
Monorepo:  React + React Native. React Alicante Monorepo:  React + React Native. React Alicante
Monorepo: React + React Native. React Alicante Eugene Zharkov
 
Monorepo: React Web & React Native
Monorepo: React Web & React NativeMonorepo: React Web & React Native
Monorepo: React Web & React NativeEugene Zharkov
 
Create React Native App vs Expo vs Manually
Create React Native App vs Expo vs ManuallyCreate React Native App vs Expo vs Manually
Create React Native App vs Expo vs ManuallyEugene Zharkov
 
Build automation with Fastlane
Build automation with FastlaneBuild automation with Fastlane
Build automation with FastlaneEugene Zharkov
 
React Native Animation
React Native AnimationReact Native Animation
React Native AnimationEugene Zharkov
 
React Native: Hurdle Race
React Native: Hurdle RaceReact Native: Hurdle Race
React Native: Hurdle RaceEugene Zharkov
 
Burn your grass with react native
Burn your grass with react nativeBurn your grass with react native
Burn your grass with react nativeEugene Zharkov
 
Фронтенд сказки
Фронтенд сказкиФронтенд сказки
Фронтенд сказкиEugene Zharkov
 
How to be a good frontend developer
How to be a good frontend developerHow to be a good frontend developer
How to be a good frontend developerEugene Zharkov
 
Cycle.js: Functional and Reactive
Cycle.js: Functional and ReactiveCycle.js: Functional and Reactive
Cycle.js: Functional and ReactiveEugene Zharkov
 
Что там в summary
Что там в summaryЧто там в summary
Что там в summaryEugene Zharkov
 
Switch to React.js from AngularJS developer
Switch to React.js from AngularJS developerSwitch to React.js from AngularJS developer
Switch to React.js from AngularJS developerEugene Zharkov
 
Mobile applications in a new way with React Native
Mobile applications in a new way with React NativeMobile applications in a new way with React Native
Mobile applications in a new way with React NativeEugene Zharkov
 
Angular 2: Всех переиграл
Angular 2: Всех переигралAngular 2: Всех переиграл
Angular 2: Всех переигралEugene Zharkov
 
Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Eugene Zharkov
 
Как объяснить на платьях процесс разработки?
Как объяснить на платьях процесс разработки?Как объяснить на платьях процесс разработки?
Как объяснить на платьях процесс разработки?Eugene Zharkov
 
Angular.JS: Do it right
Angular.JS: Do it rightAngular.JS: Do it right
Angular.JS: Do it rightEugene Zharkov
 

Más de Eugene Zharkov (20)

Monorepo: React + React Native. React Alicante
Monorepo:  React + React Native. React Alicante Monorepo:  React + React Native. React Alicante
Monorepo: React + React Native. React Alicante
 
Monorepo: React Web & React Native
Monorepo: React Web & React NativeMonorepo: React Web & React Native
Monorepo: React Web & React Native
 
Create React Native App vs Expo vs Manually
Create React Native App vs Expo vs ManuallyCreate React Native App vs Expo vs Manually
Create React Native App vs Expo vs Manually
 
Build automation with Fastlane
Build automation with FastlaneBuild automation with Fastlane
Build automation with Fastlane
 
GraphQL and/or REST
GraphQL and/or RESTGraphQL and/or REST
GraphQL and/or REST
 
React Native Animation
React Native AnimationReact Native Animation
React Native Animation
 
React Native: Hurdle Race
React Native: Hurdle RaceReact Native: Hurdle Race
React Native: Hurdle Race
 
Burn your grass with react native
Burn your grass with react nativeBurn your grass with react native
Burn your grass with react native
 
Фронтенд сказки
Фронтенд сказкиФронтенд сказки
Фронтенд сказки
 
How to be a good frontend developer
How to be a good frontend developerHow to be a good frontend developer
How to be a good frontend developer
 
Cycle.js: Functional and Reactive
Cycle.js: Functional and ReactiveCycle.js: Functional and Reactive
Cycle.js: Functional and Reactive
 
Что там в summary
Что там в summaryЧто там в summary
Что там в summary
 
Elm: give it a try
Elm: give it a tryElm: give it a try
Elm: give it a try
 
Switch to React.js from AngularJS developer
Switch to React.js from AngularJS developerSwitch to React.js from AngularJS developer
Switch to React.js from AngularJS developer
 
AngularJS: Good parts
AngularJS: Good partsAngularJS: Good parts
AngularJS: Good parts
 
Mobile applications in a new way with React Native
Mobile applications in a new way with React NativeMobile applications in a new way with React Native
Mobile applications in a new way with React Native
 
Angular 2: Всех переиграл
Angular 2: Всех переигралAngular 2: Всех переиграл
Angular 2: Всех переиграл
 
Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Angular 2.0: Brighter future?
Angular 2.0: Brighter future?
 
Как объяснить на платьях процесс разработки?
Как объяснить на платьях процесс разработки?Как объяснить на платьях процесс разработки?
Как объяснить на платьях процесс разработки?
 
Angular.JS: Do it right
Angular.JS: Do it rightAngular.JS: Do it right
Angular.JS: Do it right
 

Último

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 productivityPrincipled Technologies
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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 Takeoffsammart93
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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...Neo4j
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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 Processorsdebabhi2
 
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 WorkerThousandEyes
 

Último (20)

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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
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
 

SignalR: Add real-time to your applications

  • 1. SignalR: Add real-time to your applications by Eugene Zharkov
  • 2. Why to use SignalR? https://github.com/SignalR/SignalR 2
  • 3. Transports • WebSockets (the only true full-duplex) • Server Sent Events • Forever Frame • Long polling
  • 4. WebSockets • html5 feature • works on top of TCP protocol • full-duplex • low latency, low overhead • you need >IE10 and IIS8 • not all browsers / servers/ proxies support it
  • 5. Server Sent Events • requires a single connection between client-server • uses JS API EventSource through which client can request a particular URL to receive data stream • no need to reconnect • works in server-2-client direction only
  • 6. Forever Frames • only for IE • hidden iframes are in the load loop with chunks of data 6
  • 7. Long Polling • high overhead on requests/response (headers etc.) • medium latency 7
  • 9. Clients • iOS (SignalR-ObjC) • Android (SignalA) • Windows RT / Phone • jQuery, Backbone • Mono • QT (SignalR-QT) 9
  • 10. Requirements • Windows Server 2008 R2/2012, Windows 7/8 • IIS 8. IIS 7 and 7.5. Support for extensionless URLs is required. • >= .NET 3.5, WinRT, Silverlight 10
  • 11. Does NOT support IE 6/7 11
  • 12. Persistent Connection • the raw connection • IHTTP handler (OnConnection, OnDisconnection, OnReconnection) • custom logic must be implemented 12
  • 13. Hub • high-level API on top of Persistent Connection • route automatically mapped • clients can be divided by groups 13
  • 15. New References and Scripts 15
  • 16. Hub registration : C# public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { RouteTable.Routes.MapHubs(); AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configurat FilterConfig.RegisterGlobalFilters(GlobalFilters.Fil 01. 02. 03. 04. 05. 06. 07. 08. 16
  • 17. Hub object | C# public class Documents : Hub { public void Send(string documentName) { Clients.All.addMessage(documentName); } } 01. 02. 03. 04. 05. 06. 07. 17
  • 18. Subscribe to Hub messages | JS var documentHub = $.connection.documents; documentHub.client.addMessage = function (documentName) { $("#documents").append("<li>" + documentName + "</li>"); }; 01. 02. 03. 04. 18
  • 19. Hub object | JS $.connection.hub.logging = true; $.connection.hub.start().done(function () { $("#addDocument").click(function () { documentHub.server.send($("#document").val()); }); }); 01. 02. 03. 04. 05. 06. 19
  • 20. Working with Hub | WinRT var connection = new HubConnection("http://localhost:59576"); var hub = connection.CreateHubProxy("documents"); hub.On("addMessage", message => Dispatcher.RunAsync(CoreDispatcherPriority.Normal,() => { DocumentsCounter.Text = (++_newDocuments).ToString(); })); 01. 02. 03. 04. 05. 06. 07. 20
  • 21. Working with Hub | Android (SignalA) HubConnection con = new HubConnection("http://localhost:59576 this, new LongPollingTransport()) IHubProxy hub = con.CreateHubProxy("documents"); hub.On("addMessage", new HubOnDataCallback() { @Override public void OnReceived(.. args) { { //... }}); con.Start(); 01. 02. 03. 04. 05. 06. 07. 21
  • 22. That's all folks • @2j2e • eu.zharkov@gmail.com • http://bit.ly/signalr0 22