SlideShare a Scribd company logo
Md. Mojammel Haque
mojamcpds@gmail.com
http://codermojam.com
http://github.com/mojamcpds
Skype: mojamcpds1
RPC is a mechanism that enables the calling the
method of a system from an external/independent
system.
SignalR uses these components to have the persistent connection between client and server
and make the real time client server communication.
To call a method from client to server SignalR uses some dynamic keywords
provided by SignalR API.
Consider we have a client side method named MyClientFunc. The server
application will have to call this method. Server will make the call as follows:
Clients.Client(id).MyClientFunc()
•Clients:
•Clients is a dynamic keyword provided by SignalR.
•Clients contains the list of all connected client of the server.
•Client(id):
•Client is also a dynamic keyword provided by SignalR uses to identify the specific client by
is connection Id.
•When a client is connected to the server side application (that is powered by SignalR) are
immediately given a unique id of type Guid. The client can be identified by that id easily.
•MyClientFunc:
•The name of the method of Client that will invoke to server
The code go ahead and invoke the method from client to server. The
interaction actually happens over HTTP protocol.
Over HTTP Protocol? What about request-response? How server send
the response without any client request? How server invoke method
from client?
It is possible because SignalR always keeping the persistent connection alive between
client and server. During this connection period there is a dedicated channel is created
between client and server to talk to each other. So if something interesting happen to
the server the server can always push it to client through that channel. Also server can
call the method from client by using that channel.
During calling method from server to client it uses simple Ajax style call
Consider that we have a function in Server side called MyServerFunc. Now
the client will call it as follows:
$.connection.myhub.Server.myServerFunc()
$.connection:
Refers the persistent connection that established by the SignalR between client and
server.
myHub:
This is the name of the Hub class that resides inside server. Client will reach into that
Hub.
A server can have multiple Hubs. So in order to reach into a specific Hub client will
refer the name of that Hub
Server:
Once we reach into the specific hub we can refer the server method by using the
keyword Server.
myServerFunc():
The name of the method that we want to invoke from server to client.
From above discussion we came out a realization that
SingalR really abstracts the network transport layer and provides easy APIs on both end.
We don’t have to worry about the network transportation protocols. SingalR automatically figure out the
best transport protocol suited for the communication based on the environments of client and server.
We only maintain the Hub on server side and Hub Proxy on the client side. So we can easily invoke the
method in either end and have easy communication between the client and server.
Real Time App with SignalR

More Related Content

Similar to Real Time App with SignalR

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
 
remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure calls
Ashish Kumar
 
Middleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMIMiddleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMI
Prajakta Rane
 
How SignalR Can Simplify Your Messaging Needs? | Virtuoso Infotech
How SignalR Can Simplify Your Messaging Needs? | Virtuoso InfotechHow SignalR Can Simplify Your Messaging Needs? | Virtuoso Infotech
How SignalR Can Simplify Your Messaging Needs? | Virtuoso Infotech
VirtuosoInfotech
 
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
Jaliya Udagedara
 
Remoting and serialization
Remoting and serializationRemoting and serialization
Remoting and serialization
Chathurangi Shyalika
 
Remote procedure call on client server computing
Remote procedure call on client server computingRemote procedure call on client server computing
Remote procedure call on client server computing
Satya P. Joshi
 
awsappmesh.pdf
awsappmesh.pdfawsappmesh.pdf
awsappmesh.pdf
Learn2Skills |
 
Android framework design and development
Android framework design and developmentAndroid framework design and development
Android framework design and development
ramalinga prasad tadepalli
 
Real Time Web with SignalR
Real Time Web with SignalRReal Time Web with SignalR
Real Time Web with SignalR
Bilal Amjad
 
Remote procedure calls
Remote procedure callsRemote procedure calls
Remote procedure calls
imnomus
 
Stephy
StephyStephy
Stephy
Stephy Sunny
 
Stephy
StephyStephy
Stephy
Stephy Sunny
 
Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1
Vishal Kumar
 
The Fundamental of Secure Socket Layer (SSL)
The Fundamental of Secure Socket Layer (SSL)The Fundamental of Secure Socket Layer (SSL)
The Fundamental of Secure Socket Layer (SSL)
Vishal Kumar
 
The application architeture is design by the application developer a.pdf
The application architeture is design by the application developer a.pdfThe application architeture is design by the application developer a.pdf
The application architeture is design by the application developer a.pdf
solimankellymattwe60
 
CLIENT SERVER IN OS.ppt
CLIENT SERVER IN OS.pptCLIENT SERVER IN OS.ppt
CLIENT SERVER IN OS.ppt
suman yadav
 
.NET Core, ASP.NET Core Course, Session 19
 .NET Core, ASP.NET Core Course, Session 19 .NET Core, ASP.NET Core Course, Session 19
.NET Core, ASP.NET Core Course, Session 19
aminmesbahi
 
Client server chat application
Client server chat applicationClient server chat application
Client server chat application
Samsil Arefin
 
End-to-End Security in Mobile-Cloud Computing
End-to-End Security in Mobile-Cloud ComputingEnd-to-End Security in Mobile-Cloud Computing
End-to-End Security in Mobile-Cloud Computing
Dr Sukhpal Singh Gill
 

Similar to Real Time App with SignalR (20)

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
 
remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure calls
 
Middleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMIMiddleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMI
 
How SignalR Can Simplify Your Messaging Needs? | Virtuoso Infotech
How SignalR Can Simplify Your Messaging Needs? | Virtuoso InfotechHow SignalR Can Simplify Your Messaging Needs? | Virtuoso Infotech
How SignalR Can Simplify Your Messaging Needs? | Virtuoso Infotech
 
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
 
Remoting and serialization
Remoting and serializationRemoting and serialization
Remoting and serialization
 
Remote procedure call on client server computing
Remote procedure call on client server computingRemote procedure call on client server computing
Remote procedure call on client server computing
 
awsappmesh.pdf
awsappmesh.pdfawsappmesh.pdf
awsappmesh.pdf
 
Android framework design and development
Android framework design and developmentAndroid framework design and development
Android framework design and development
 
Real Time Web with SignalR
Real Time Web with SignalRReal Time Web with SignalR
Real Time Web with SignalR
 
Remote procedure calls
Remote procedure callsRemote procedure calls
Remote procedure calls
 
Stephy
StephyStephy
Stephy
 
Stephy
StephyStephy
Stephy
 
Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1
 
The Fundamental of Secure Socket Layer (SSL)
The Fundamental of Secure Socket Layer (SSL)The Fundamental of Secure Socket Layer (SSL)
The Fundamental of Secure Socket Layer (SSL)
 
The application architeture is design by the application developer a.pdf
The application architeture is design by the application developer a.pdfThe application architeture is design by the application developer a.pdf
The application architeture is design by the application developer a.pdf
 
CLIENT SERVER IN OS.ppt
CLIENT SERVER IN OS.pptCLIENT SERVER IN OS.ppt
CLIENT SERVER IN OS.ppt
 
.NET Core, ASP.NET Core Course, Session 19
 .NET Core, ASP.NET Core Course, Session 19 .NET Core, ASP.NET Core Course, Session 19
.NET Core, ASP.NET Core Course, Session 19
 
Client server chat application
Client server chat applicationClient server chat application
Client server chat application
 
End-to-End Security in Mobile-Cloud Computing
End-to-End Security in Mobile-Cloud ComputingEnd-to-End Security in Mobile-Cloud Computing
End-to-End Security in Mobile-Cloud Computing
 

Recently uploaded

Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 

Recently uploaded (20)

Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 

Real Time App with SignalR

  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. RPC is a mechanism that enables the calling the method of a system from an external/independent system.
  • 20.
  • 21.
  • 22.
  • 23. SignalR uses these components to have the persistent connection between client and server and make the real time client server communication.
  • 24. To call a method from client to server SignalR uses some dynamic keywords provided by SignalR API.
  • 25. Consider we have a client side method named MyClientFunc. The server application will have to call this method. Server will make the call as follows: Clients.Client(id).MyClientFunc()
  • 26. •Clients: •Clients is a dynamic keyword provided by SignalR. •Clients contains the list of all connected client of the server. •Client(id): •Client is also a dynamic keyword provided by SignalR uses to identify the specific client by is connection Id. •When a client is connected to the server side application (that is powered by SignalR) are immediately given a unique id of type Guid. The client can be identified by that id easily. •MyClientFunc: •The name of the method of Client that will invoke to server
  • 27. The code go ahead and invoke the method from client to server. The interaction actually happens over HTTP protocol. Over HTTP Protocol? What about request-response? How server send the response without any client request? How server invoke method from client? It is possible because SignalR always keeping the persistent connection alive between client and server. During this connection period there is a dedicated channel is created between client and server to talk to each other. So if something interesting happen to the server the server can always push it to client through that channel. Also server can call the method from client by using that channel.
  • 28. During calling method from server to client it uses simple Ajax style call
  • 29. Consider that we have a function in Server side called MyServerFunc. Now the client will call it as follows: $.connection.myhub.Server.myServerFunc()
  • 30. $.connection: Refers the persistent connection that established by the SignalR between client and server. myHub: This is the name of the Hub class that resides inside server. Client will reach into that Hub. A server can have multiple Hubs. So in order to reach into a specific Hub client will refer the name of that Hub Server: Once we reach into the specific hub we can refer the server method by using the keyword Server. myServerFunc(): The name of the method that we want to invoke from server to client.
  • 31. From above discussion we came out a realization that SingalR really abstracts the network transport layer and provides easy APIs on both end. We don’t have to worry about the network transportation protocols. SingalR automatically figure out the best transport protocol suited for the communication based on the environments of client and server. We only maintain the Hub on server side and Hub Proxy on the client side. So we can easily invoke the method in either end and have easy communication between the client and server.