SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
Welcome to the Real-time world of web
Martin Bodocky
What’s SignalR?
 SignalR is an asynchronous signaling library for
ASP.Net, to help build real-time multi-user web
application.
 SignalR is a compete client and server side solution
with JavaScript(jQuery) on client and ASP.Net on the
back end to create these kinds of application.
How does it work? 1/2
 Html 5 transports
 WebSocket – It establishes a true persistent, two-way
connection. It should be supported on server and client.
Just latest versions of IE, Google Chrome and Mozilla
FireFox, only partly implemented on Opera and Safari.
 Ideal transport technology, it makes the most efficient use of
server memory, has the lowest latency.
 Server Sent Events (EventSource) – it supports by all
browser who supports HTML5 expect Internet Explorer
How does it work? 2/2
 Comet(1) transports (when HTML5 is not supported)
 Forever Frame (IE only) – It creates a hidden IFrame on
which is executing scripts, those are continually sending
from server.
 Ajax long polling – It doesn’t create a persistent
connection, but instead polls the server with a request
that stays open until the server responds, at which point
the connection closes, and a new connection is
requested immediately.
Picture was taken from http://www.asp.net/signalr
Architecture Diagram
SignalR API
 SignalR provides a simple API for creating server-to-
client remote procedure calls (RPC) that call JavaScript
functions in client browsers from server-side .Net
code. SignalR package is available by NuGet:
 SignalR – A meta package that brings in SignalR.Server and
SignalR.Js (this is necessary)
 SignalR.Server – Server side components needed to build SignalR
endpoints
 SignalR.Js – Javascript client for SignalR
 SignalR.Client - .Net client for SignalR
 SignalR.Ninject – Ninject dependency resolver for SignalR
Communication with SignalR
Picture was taken from http://www.asp.net/signalr
Server Side – Hub 1/2
 Top layer of PersistentConnection
 Can connect with 1-N clients
 Can send messages and call methods
 Routes automatically mapped
 SignalR handle the binding of complex object and
arrays of objects automatically
 Communication is serialized by JSON
 Hubs are per call, which means, each call from client
to the hub will create a new hub instance. Don’t setup
static event handlers in hub methods.(3)
Server Side – Hub 2/2
public class ChatHub : Hub
{
public void Send(string name, string message)
{
//Call the broadcast message method
//to update all clients
Clients.All.broadcastMessage(name, message);
}
}
Client Side 1/3
<script src="Scripts/jquery-1.8.2.min.js" ></script>
<script src="Scripts/jquery.signalR-1.0.0.min.js" ></script>
<script src="/signalr/hubs" ></script>
<script type="text/javascript">
$(function () {
//Declare a proxy to reference the hub
var chat = $.connection.chatHub;
//Create a function that the hub can call to broadcast messages
= function (name, message) {
//Omitted
};
//Start the connection
(function () {
$("#sendMessage").click(function () {
//Call the Send method on the hub
chat.server.send($("#displayName").val(), $("#message").val());
});
});
});
</script>
Client Side 2/3
 Exposing methods from the server - The JavaScript
client can declare methods that the server can invoke.
Method – name of the client side method
Callback – A function to execute when the server
invokes the method
- If you misspell names you will not get any warnings or
notifications even when logging is enabled. On server
side is method call hosted on dynamic property (Clients)
Client Side 3/3
 JavaScript API
 $.connection.hub – The connection for all hubs
 $.connection.hub.id – The client id for the hub
connection
 $.connection.hub.logging – Set to true to enable logging.
 $.connection.hub.start() – Starts the connection for all
hubs.
Hub routing
 Register the route for generated SignalR hubs
 Register on server side in Application_Start on
global class:
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
//Register the default hubs route: ~/signalr/hubs
RouteTable.Routes.MapHubs();
}
}
 Register on client side:
<script src="/signalr/hubs" ></script>
Some demos
Chat
Shape move
Stock ticker
What’s it good for?
 Dashboards
 Monitoring
 Collaborative tools
 Job progress
 Real-time form
 Web games
 Trading
 Traffic systems, etc.
SignalR requirements
 OS:
 Windows Server 2012
 Windows Server 2008 R2
 Windows 8/7
 Windows Azure
 IIS – 7/7.5(with Extensionless URL(2)); 8/8 Express
 .Net – 4.5 framework
 Browser - http://caniuse.com/#feat=websockets
SignalR with SharePoint 2013
 There is a way:
http://melcher.it/2012/12/signalr-in-sharepoint-2013-
the-real-time-web-is-coming
http://spsignalr.codeplex.com/
References
 1.) Comet -
http://en.wikipedia.org/wiki/Comet_(programming)
 2.) ISS with Extesionless url support –
http://support.microsoft.com/kb/980368
 3.) Hub api giude server -
http://www.asp.net/signalr/overview/hubs-api/hubs-
api-guide-server

Contenu connexe

Tendances

Asp.net membership anduserroles_ppt
Asp.net membership anduserroles_pptAsp.net membership anduserroles_ppt
Asp.net membership anduserroles_pptShivanand Arur
 
Web Applications Development with MEAN Stack
Web Applications Development with MEAN StackWeb Applications Development with MEAN Stack
Web Applications Development with MEAN StackShailendra Chauhan
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance TopicsAli Taki
 
Introduction to WebSockets Presentation
Introduction to WebSockets PresentationIntroduction to WebSockets Presentation
Introduction to WebSockets PresentationJulien LaPointe
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development PresentationTurnToTech
 
Android Architecture.pptx
Android Architecture.pptxAndroid Architecture.pptx
Android Architecture.pptxpriya Nithya
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsRob O'Doherty
 
Selenium Architecture
Selenium ArchitectureSelenium Architecture
Selenium Architecturerohitnayak
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & DevelopmentAshok Pundit
 
c#.Net Windows application
c#.Net Windows application c#.Net Windows application
c#.Net Windows application veera
 
Ppt of soap ui
Ppt of soap uiPpt of soap ui
Ppt of soap uipkslide28
 

Tendances (20)

Asp.net membership anduserroles_ppt
Asp.net membership anduserroles_pptAsp.net membership anduserroles_ppt
Asp.net membership anduserroles_ppt
 
Web Applications Development with MEAN Stack
Web Applications Development with MEAN StackWeb Applications Development with MEAN Stack
Web Applications Development with MEAN Stack
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Introduction to WebSockets Presentation
Introduction to WebSockets PresentationIntroduction to WebSockets Presentation
Introduction to WebSockets Presentation
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development Presentation
 
Android Architecture.pptx
Android Architecture.pptxAndroid Architecture.pptx
Android Architecture.pptx
 
Angular material
Angular materialAngular material
Angular material
 
Postman
PostmanPostman
Postman
 
React native
React nativeReact native
React native
 
Intro to WebSockets
Intro to WebSocketsIntro to WebSockets
Intro to WebSockets
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Selenium Architecture
Selenium ArchitectureSelenium Architecture
Selenium Architecture
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
c#.Net Windows application
c#.Net Windows application c#.Net Windows application
c#.Net Windows application
 
Express js
Express jsExpress js
Express js
 
Ppt of soap ui
Ppt of soap uiPpt of soap ui
Ppt of soap ui
 
Rest assured
Rest assuredRest assured
Rest assured
 
IIS
IISIIS
IIS
 

En vedette

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 2012Maarten Balliauw
 
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
 
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
 
Signalr with ASP.Net part2
Signalr with ASP.Net part2Signalr with ASP.Net part2
Signalr with ASP.Net part2Esraa Ammar
 
Microsoft WebApi & SignalR
Microsoft WebApi & SignalRMicrosoft WebApi & SignalR
Microsoft WebApi & SignalRRobin Sedlaczek
 
SignalR
SignalRSignalR
SignalRmstDe3
 
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel AppelBuilding Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel.NET Conf UY
 
Real time web applications with SignalR (BNE .NET UG)
Real time web applications with SignalR (BNE .NET UG)Real time web applications with SignalR (BNE .NET UG)
Real time web applications with SignalR (BNE .NET UG)brendankowitz
 
ELEIÇÕES 2012 - ASTORGA: Toninho 31123
 ELEIÇÕES 2012 - ASTORGA: Toninho 31123 ELEIÇÕES 2012 - ASTORGA: Toninho 31123
ELEIÇÕES 2012 - ASTORGA: Toninho 31123Joao Carlos Passari
 
Presentation websockets
Presentation websocketsPresentation websockets
Presentation websocketsBert Poller
 
«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NETAlessandro Giorgetti
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET CoreAvanade Nederland
 

En vedette (19)

SignalR
SignalRSignalR
SignalR
 
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
 
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)
 
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
 
SignalR
SignalRSignalR
SignalR
 
SignalR
SignalRSignalR
SignalR
 
Real time web with SignalR
Real time web with SignalRReal time web with SignalR
Real time web with 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
 
Signalr with ASP.Net part2
Signalr with ASP.Net part2Signalr with ASP.Net part2
Signalr with ASP.Net part2
 
Microsoft WebApi & SignalR
Microsoft WebApi & SignalRMicrosoft WebApi & SignalR
Microsoft WebApi & SignalR
 
SignalR
SignalRSignalR
SignalR
 
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel AppelBuilding Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
 
Real time web applications with SignalR (BNE .NET UG)
Real time web applications with SignalR (BNE .NET UG)Real time web applications with SignalR (BNE .NET UG)
Real time web applications with SignalR (BNE .NET UG)
 
ELEIÇÕES 2012 - ASTORGA: Toninho 31123
 ELEIÇÕES 2012 - ASTORGA: Toninho 31123 ELEIÇÕES 2012 - ASTORGA: Toninho 31123
ELEIÇÕES 2012 - ASTORGA: Toninho 31123
 
Presentation websockets
Presentation websocketsPresentation websockets
Presentation websockets
 
«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET
 
Proyecto de estimulacion cognitiva
Proyecto de estimulacion cognitivaProyecto de estimulacion cognitiva
Proyecto de estimulacion cognitiva
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET Core
 

Similaire à SignalR with asp.net

Real-Time Communication
Real-Time CommunicationReal-Time Communication
Real-Time Communicationssusere19c741
 
SignalR Powered X-Platform Real-Time Apps!
SignalR Powered X-Platform Real-Time Apps!SignalR Powered X-Platform Real-Time Apps!
SignalR Powered X-Platform Real-Time Apps!Sam Basu
 
Reactive Application Using METEOR
Reactive Application Using METEORReactive Application Using METEOR
Reactive Application Using METEORNodeXperts
 
Real Time Web with SignalR
Real Time Web with SignalRReal Time Web with SignalR
Real Time Web with SignalRBilal Amjad
 
SignalR Intro + WPDev
SignalR Intro + WPDevSignalR Intro + WPDev
SignalR Intro + WPDevSam Basu
 
SignalR tutorial & best practices
SignalR tutorial & best practicesSignalR tutorial & best practices
SignalR tutorial & best practicesMinh Ng
 
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
 
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use CasesAn In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use CasesTien Nguyen
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices ArchitectureIdan Fridman
 
SignalR powered real-time x-plat mobile apps!
SignalR powered real-time x-plat mobile apps!SignalR powered real-time x-plat mobile apps!
SignalR powered real-time x-plat mobile apps!Sam Basu
 
Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1KlaraOrban
 
Reverse ajax in 2014
Reverse ajax in 2014Reverse ajax in 2014
Reverse ajax in 2014Nenad Pecanac
 
IoT with SignalR & .NET Gadgeteer - NetMF@Work
IoT with SignalR & .NET Gadgeteer - NetMF@WorkIoT with SignalR & .NET Gadgeteer - NetMF@Work
IoT with SignalR & .NET Gadgeteer - NetMF@WorkMirco Vanini
 
Client server chat application
Client server chat applicationClient server chat application
Client server chat applicationSamsil Arefin
 
How SignalR and SQL Dependency Work Process in ASP.NET with SQL Server?
How SignalR  and SQL Dependency Work Process in ASP.NET with SQL Server?How SignalR  and SQL Dependency Work Process in ASP.NET with SQL Server?
How SignalR and SQL Dependency Work Process in ASP.NET with SQL Server?Raju Ahmed
 
Server side programming
Server side programming Server side programming
Server side programming javed ahmed
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaJoe Stein
 

Similaire à SignalR with asp.net (20)

Signal r
Signal rSignal r
Signal r
 
Real-Time Communication
Real-Time CommunicationReal-Time Communication
Real-Time Communication
 
SignalR Powered X-Platform Real-Time Apps!
SignalR Powered X-Platform Real-Time Apps!SignalR Powered X-Platform Real-Time Apps!
SignalR Powered X-Platform Real-Time Apps!
 
Reactive Application Using METEOR
Reactive Application Using METEORReactive Application Using METEOR
Reactive Application Using METEOR
 
Real Time Web with SignalR
Real Time Web with SignalRReal Time Web with SignalR
Real Time Web with SignalR
 
SignalR Intro + WPDev
SignalR Intro + WPDevSignalR Intro + WPDev
SignalR Intro + WPDev
 
SignalR tutorial & best practices
SignalR tutorial & best practicesSignalR tutorial & best practices
SignalR tutorial & best practices
 
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
 
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use CasesAn In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
 
Client server project
Client server projectClient server project
Client server project
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices Architecture
 
SignalR powered real-time x-plat mobile apps!
SignalR powered real-time x-plat mobile apps!SignalR powered real-time x-plat mobile apps!
SignalR powered real-time x-plat mobile apps!
 
Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1
 
Reverse ajax in 2014
Reverse ajax in 2014Reverse ajax in 2014
Reverse ajax in 2014
 
IoT with SignalR & .NET Gadgeteer - NetMF@Work
IoT with SignalR & .NET Gadgeteer - NetMF@WorkIoT with SignalR & .NET Gadgeteer - NetMF@Work
IoT with SignalR & .NET Gadgeteer - NetMF@Work
 
Client server chat application
Client server chat applicationClient server chat application
Client server chat application
 
Introduction to ns3
Introduction to ns3Introduction to ns3
Introduction to ns3
 
How SignalR and SQL Dependency Work Process in ASP.NET with SQL Server?
How SignalR  and SQL Dependency Work Process in ASP.NET with SQL Server?How SignalR  and SQL Dependency Work Process in ASP.NET with SQL Server?
How SignalR and SQL Dependency Work Process in ASP.NET with SQL Server?
 
Server side programming
Server side programming Server side programming
Server side programming
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache Kafka
 

Plus de Martin Bodocky

Vienna value investing meetup 6
Vienna value investing meetup  6Vienna value investing meetup  6
Vienna value investing meetup 6Martin Bodocky
 
Vienna value investing meetup #5
Vienna value investing meetup  #5Vienna value investing meetup  #5
Vienna value investing meetup #5Martin Bodocky
 
Vienna value investing meetup #4
Vienna value investing meetup #4Vienna value investing meetup #4
Vienna value investing meetup #4Martin Bodocky
 
Mint It Picth EU-Startups in Berlin
Mint It Picth EU-Startups in BerlinMint It Picth EU-Startups in Berlin
Mint It Picth EU-Startups in BerlinMartin Bodocky
 
Vienna value investing meetup #3
Vienna value investing meetup #3Vienna value investing meetup #3
Vienna value investing meetup #3Martin Bodocky
 
Vienna FinTech Meetup #5 - Mint It
Vienna FinTech Meetup #5 - Mint ItVienna FinTech Meetup #5 - Mint It
Vienna FinTech Meetup #5 - Mint ItMartin Bodocky
 
Vienna value investing meetup #2
Vienna value investing meetup #2Vienna value investing meetup #2
Vienna value investing meetup #2Martin Bodocky
 
Vienna value investing meetup #1
Vienna value investing meetup #1Vienna value investing meetup #1
Vienna value investing meetup #1Martin Bodocky
 
Share point 2013 certification
Share point 2013 certificationShare point 2013 certification
Share point 2013 certificationMartin Bodocky
 

Plus de Martin Bodocky (9)

Vienna value investing meetup 6
Vienna value investing meetup  6Vienna value investing meetup  6
Vienna value investing meetup 6
 
Vienna value investing meetup #5
Vienna value investing meetup  #5Vienna value investing meetup  #5
Vienna value investing meetup #5
 
Vienna value investing meetup #4
Vienna value investing meetup #4Vienna value investing meetup #4
Vienna value investing meetup #4
 
Mint It Picth EU-Startups in Berlin
Mint It Picth EU-Startups in BerlinMint It Picth EU-Startups in Berlin
Mint It Picth EU-Startups in Berlin
 
Vienna value investing meetup #3
Vienna value investing meetup #3Vienna value investing meetup #3
Vienna value investing meetup #3
 
Vienna FinTech Meetup #5 - Mint It
Vienna FinTech Meetup #5 - Mint ItVienna FinTech Meetup #5 - Mint It
Vienna FinTech Meetup #5 - Mint It
 
Vienna value investing meetup #2
Vienna value investing meetup #2Vienna value investing meetup #2
Vienna value investing meetup #2
 
Vienna value investing meetup #1
Vienna value investing meetup #1Vienna value investing meetup #1
Vienna value investing meetup #1
 
Share point 2013 certification
Share point 2013 certificationShare point 2013 certification
Share point 2013 certification
 

Dernier

Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 

Dernier (20)

Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 

SignalR with asp.net

  • 1. Welcome to the Real-time world of web Martin Bodocky
  • 2. What’s SignalR?  SignalR is an asynchronous signaling library for ASP.Net, to help build real-time multi-user web application.  SignalR is a compete client and server side solution with JavaScript(jQuery) on client and ASP.Net on the back end to create these kinds of application.
  • 3. How does it work? 1/2  Html 5 transports  WebSocket – It establishes a true persistent, two-way connection. It should be supported on server and client. Just latest versions of IE, Google Chrome and Mozilla FireFox, only partly implemented on Opera and Safari.  Ideal transport technology, it makes the most efficient use of server memory, has the lowest latency.  Server Sent Events (EventSource) – it supports by all browser who supports HTML5 expect Internet Explorer
  • 4. How does it work? 2/2  Comet(1) transports (when HTML5 is not supported)  Forever Frame (IE only) – It creates a hidden IFrame on which is executing scripts, those are continually sending from server.  Ajax long polling – It doesn’t create a persistent connection, but instead polls the server with a request that stays open until the server responds, at which point the connection closes, and a new connection is requested immediately.
  • 5. Picture was taken from http://www.asp.net/signalr Architecture Diagram
  • 6. SignalR API  SignalR provides a simple API for creating server-to- client remote procedure calls (RPC) that call JavaScript functions in client browsers from server-side .Net code. SignalR package is available by NuGet:  SignalR – A meta package that brings in SignalR.Server and SignalR.Js (this is necessary)  SignalR.Server – Server side components needed to build SignalR endpoints  SignalR.Js – Javascript client for SignalR  SignalR.Client - .Net client for SignalR  SignalR.Ninject – Ninject dependency resolver for SignalR
  • 7. Communication with SignalR Picture was taken from http://www.asp.net/signalr
  • 8. Server Side – Hub 1/2  Top layer of PersistentConnection  Can connect with 1-N clients  Can send messages and call methods  Routes automatically mapped  SignalR handle the binding of complex object and arrays of objects automatically  Communication is serialized by JSON  Hubs are per call, which means, each call from client to the hub will create a new hub instance. Don’t setup static event handlers in hub methods.(3)
  • 9. Server Side – Hub 2/2 public class ChatHub : Hub { public void Send(string name, string message) { //Call the broadcast message method //to update all clients Clients.All.broadcastMessage(name, message); } }
  • 10. Client Side 1/3 <script src="Scripts/jquery-1.8.2.min.js" ></script> <script src="Scripts/jquery.signalR-1.0.0.min.js" ></script> <script src="/signalr/hubs" ></script> <script type="text/javascript"> $(function () { //Declare a proxy to reference the hub var chat = $.connection.chatHub; //Create a function that the hub can call to broadcast messages = function (name, message) { //Omitted }; //Start the connection (function () { $("#sendMessage").click(function () { //Call the Send method on the hub chat.server.send($("#displayName").val(), $("#message").val()); }); }); }); </script>
  • 11. Client Side 2/3  Exposing methods from the server - The JavaScript client can declare methods that the server can invoke. Method – name of the client side method Callback – A function to execute when the server invokes the method - If you misspell names you will not get any warnings or notifications even when logging is enabled. On server side is method call hosted on dynamic property (Clients)
  • 12. Client Side 3/3  JavaScript API  $.connection.hub – The connection for all hubs  $.connection.hub.id – The client id for the hub connection  $.connection.hub.logging – Set to true to enable logging.  $.connection.hub.start() – Starts the connection for all hubs.
  • 13. Hub routing  Register the route for generated SignalR hubs  Register on server side in Application_Start on global class: public class Global : System.Web.HttpApplication { protected void Application_Start(object sender, EventArgs e) { //Register the default hubs route: ~/signalr/hubs RouteTable.Routes.MapHubs(); } }  Register on client side: <script src="/signalr/hubs" ></script>
  • 15. What’s it good for?  Dashboards  Monitoring  Collaborative tools  Job progress  Real-time form  Web games  Trading  Traffic systems, etc.
  • 16. SignalR requirements  OS:  Windows Server 2012  Windows Server 2008 R2  Windows 8/7  Windows Azure  IIS – 7/7.5(with Extensionless URL(2)); 8/8 Express  .Net – 4.5 framework  Browser - http://caniuse.com/#feat=websockets
  • 17. SignalR with SharePoint 2013  There is a way: http://melcher.it/2012/12/signalr-in-sharepoint-2013- the-real-time-web-is-coming http://spsignalr.codeplex.com/
  • 18. References  1.) Comet - http://en.wikipedia.org/wiki/Comet_(programming)  2.) ISS with Extesionless url support – http://support.microsoft.com/kb/980368  3.) Hub api giude server - http://www.asp.net/signalr/overview/hubs-api/hubs- api-guide-server