SlideShare a Scribd company logo
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

More Related Content

What's hot

Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
Nitin Pande
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
Rest web services
Rest web servicesRest web services
Rest web services
Paulo Gandra de Sousa
 
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
 
Web Servers: Architecture and Security
Web Servers: Architecture and SecurityWeb Servers: Architecture and Security
Web Servers: Architecture and Securitygeorge.james
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - API
Chetan Gadodia
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
Christopher Bartling
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVC
IndicThreads
 
Web servers
Web serversWeb servers
Web servers
Kuldeep Kulkarni
 
WebRTC presentation
WebRTC presentationWebRTC presentation
WebRTC presentation
Sreenivas Kappala
 
Spring security oauth2
Spring security oauth2Spring security oauth2
Spring security oauth2
axykim00
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
Edureka!
 
Remote Method Invocation in JAVA
Remote Method Invocation in JAVARemote Method Invocation in JAVA
Remote Method Invocation in JAVA
Jalpesh Vasa
 
Restful web services ppt
Restful web services pptRestful web services ppt
Introduction to WebSockets Presentation
Introduction to WebSockets PresentationIntroduction to WebSockets Presentation
Introduction to WebSockets Presentation
Julien LaPointe
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
Aniruddh Bhilvare
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
07.pallav
 

What's hot (20)

Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Rest web services
Rest web servicesRest web services
Rest web services
 
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?
 
Web Servers: Architecture and Security
Web Servers: Architecture and SecurityWeb Servers: Architecture and Security
Web Servers: Architecture and Security
 
web server
web serverweb server
web server
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - API
 
Web server
Web serverWeb server
Web server
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVC
 
Web servers
Web serversWeb servers
Web servers
 
WebRTC presentation
WebRTC presentationWebRTC presentation
WebRTC presentation
 
Spring security oauth2
Spring security oauth2Spring security oauth2
Spring security oauth2
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
 
Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
 
Remote Method Invocation in JAVA
Remote Method Invocation in JAVARemote Method Invocation in JAVA
Remote Method Invocation in JAVA
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
Introduction to WebSockets Presentation
Introduction to WebSockets PresentationIntroduction to WebSockets Presentation
Introduction to WebSockets Presentation
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 

Viewers also liked

SignalR
SignalRSignalR
SignalR
Troy Miles
 
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
SignalRSignalR
SignalR
Eyal Vardi
 
Real time web with SignalR
Real time web with SignalRReal time web with SignalR
Real time web with SignalR
Alessandro Melchiori
 
SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6
Tung Nguyen Thanh
 
Signalr with ASP.Net part2
Signalr with ASP.Net part2Signalr with ASP.Net part2
Signalr with ASP.Net part2
Esraa Ammar
 
Microsoft WebApi & SignalR
Microsoft WebApi & SignalRMicrosoft WebApi & SignalR
Microsoft WebApi & SignalR
Robin Sedlaczek
 
SignalR
SignalRSignalR
SignalR
mstDe3
 
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 websockets
Bert 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.NET
Alessandro Giorgetti
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance TopicsAli Taki
 
Proyecto de estimulacion cognitiva
Proyecto de estimulacion cognitivaProyecto de estimulacion cognitiva
Proyecto de estimulacion cognitiva
Pedro Roberto Casanova
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET Core
Avanade Nederland
 

Viewers also liked (20)

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
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
 
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
 

Similar to SignalR with asp.net

Signal r
Signal rSignal r
Signal r
Vasilios Kuznos
 
Real-Time Communication
Real-Time CommunicationReal-Time Communication
Real-Time Communication
ssusere19c741
 
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 METEOR
NodeXperts
 
Real Time Web with SignalR
Real Time Web with SignalRReal Time Web with SignalR
Real Time Web with SignalR
Bilal 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 practices
Minh 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 SignalR
Vladimir 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 Cases
Tien Nguyen
 
Client server project
Client server projectClient server project
Client server project
yogendra kumar patel
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices Architecture
Idan 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
 
Reverse ajax in 2014
Reverse ajax in 2014Reverse ajax in 2014
Reverse ajax in 2014
Nenad 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@Work
Mirco Vanini
 
Client server chat application
Client server chat applicationClient server chat application
Client server chat application
Samsil Arefin
 
Introduction to ns3
Introduction to ns3Introduction to ns3
Introduction to ns3
Shahid Beheshti University
 
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 Kafka
Joe Stein
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
Sapna Upreti
 
How a network connection is created A network connection is initi.pdf
How a network connection is created A network connection is initi.pdfHow a network connection is created A network connection is initi.pdf
How a network connection is created A network connection is initi.pdf
arccreation001
 

Similar to 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!
 
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
 
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
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
 
How a network connection is created A network connection is initi.pdf
How a network connection is created A network connection is initi.pdfHow a network connection is created A network connection is initi.pdf
How a network connection is created A network connection is initi.pdf
 

More from Martin Bodocky

Vienna value investing meetup 6
Vienna value investing meetup  6Vienna value investing meetup  6
Vienna value investing meetup 6
Martin Bodocky
 
Vienna value investing meetup #5
Vienna value investing meetup  #5Vienna value investing meetup  #5
Vienna value investing meetup #5
Martin Bodocky
 
Vienna value investing meetup #4
Vienna value investing meetup #4Vienna value investing meetup #4
Vienna value investing meetup #4
Martin 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 Berlin
Martin Bodocky
 
Vienna value investing meetup #3
Vienna value investing meetup #3Vienna value investing meetup #3
Vienna value investing meetup #3
Martin Bodocky
 
Vienna FinTech Meetup #5 - Mint It
Vienna FinTech Meetup #5 - Mint ItVienna FinTech Meetup #5 - Mint It
Vienna FinTech Meetup #5 - Mint It
Martin Bodocky
 
Vienna value investing meetup #2
Vienna value investing meetup #2Vienna value investing meetup #2
Vienna value investing meetup #2
Martin Bodocky
 
Vienna value investing meetup #1
Vienna value investing meetup #1Vienna value investing meetup #1
Vienna value investing meetup #1
Martin Bodocky
 
Share point 2013 certification
Share point 2013 certificationShare point 2013 certification
Share point 2013 certificationMartin Bodocky
 

More from 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
 

Recently uploaded

UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 

Recently uploaded (20)

UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 

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