Mortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazing
SignalR with ASP.NET MVC 6
-
Upload
tung-nguyen-thanh -
Category
Software
-
view
1.105 -
download
0
Transcript of SignalR with ASP.NET MVC 6
SIGNALR + ASP.NET MVCLEVERAGING ON REAL-TIME DATA UPDATES
TOPICS
• Introduction to ASP.NET MVC 6 + ASP.NET 5• Key Concepts of SignalR• Quick Look at SignalR• SignalR with ASP.NET MVC 6 deep-dive demo• Questions & Answer
ASP.NET MVC 6 + ASP.NET 5
• ASP.NET is now on Mac and Linux• No More Web Forms• No More Visual Basic• Tag Helpers versus MVC Helpers• View Components• Microsoft.AspNet.Mvc.Controller• AngularJS
SIGNALRAdvocating a Real Time Data Communication between UIs
KEY CONCEPTS
•Remote Procedural Calls (RPC)•WebSocket Wrapper•Transports & Fallbacks
KEY CONCEPTS: “SERVER PUSHING”
“SignalR supports "server push" functionality, in which server code can call out to client code in the browser using Remote Procedure Calls (RPC),
rather than the request-response model common on the web today. ”
KEY CONCEPTS: TRANSPORTS
• HTML5 Transports• WebSocket – only transport that establishes true two way persistent
connection• Server Sent Events - EventSource
• Comet Transports (makes use of HTTP)• Forever Frame (only IE)• Ajax Long Polling
KEY CONCEPTS: TRANSPORTS
$.connection.hub.logging = true;
• Enable Logging in your code• Opening the Console Window in your web browser
KEY CONCEPTS: SPECIFYING A TRANSPORT
If you know the client’s capability…connection.start({ transport: 'longPolling' });
If not, always make sure there is a fallback…connection.start({ transport:
['webSockets','longPolling'] });
KEY CONCEPTS: SPECIFYING A TRANSPORT
•webSockets•foreverFrame•serverSentEvents• longPolling
KEY CONCEPTS: CONNECTIONS & HUBS
• Persistent Connection• Low-level communication protocol• PersistentConnection class
• Hub• High-level pipeline• Allowing clients to call methods on servers• Similarity to .NET Remoting
KEY CONCEPTS: HOW HUBS WORK
• Server-side calls a method on the client• A packet is sent across (name of method + parameters)
• If the parameter is an object, it will be serialized as JSON• Client checks to see if the method exists in client-side coding• If exists, the method is executed using the deserialized parameter
data.
KEY CONCEPTS: WHEN TO USE PERSISTENT CONNECTION?• The format of the actual message sent needs to be specified.• The developer prefers to work with a messaging and dispatching
model rather than a remote invocation model.• An existing application that uses a messaging model is being ported
to use SignalR.
GETTING STARTED
install-package Microsoft.AspNet.SignalR
DEMO
TELERIK PROFILE
•Since 2002•Over 1.7 million developers•Developer-focused
ABIT ABOUT TELERIK
• UI Toolkits – Web Forms, MVC, Silverlight, Kendo UI, WinForms, WPF, UWP (Windows 10), and many more.
• Telerik Test Studio – Automated Testing solution (Native Mobile Apps)• Telerik Platform – Cross-platform Mobile App Development &
Management• Telerik Sitefinity – Web Content Management System
CONTACT
• http://theprogrammingnerd.com• http://github.com/telerikgeek• Skype: metanoia.sherman• Instagram: telerikgeek• Twitter: telerikgeek
QUESTIONS?