Разделы презентаций


Real-time ASP.NET with SignalR

Содержание

Web evolution

Слайды и текст этой презентации

Слайд 1Real-time ASP.NET with SignalR
Alex Konduforov
AltexSoft

Real-time ASP.NET with SignalRAlex KonduforovAltexSoft

Слайд 2Web evolution

Web evolution

Слайд 3USERS WANT THE LATEST INFO NOW!

USERS WANT THE LATEST INFO  NOW!

Слайд 4Social networks

Social networks

Слайд 5Auctions

Auctions

Слайд 6Stock tickers

Stock tickers

Слайд 7Web chats

Web chats

Слайд 8Other applications
Live scores
Real-time notifications
Interactive games
Collaborative apps
Live user analytics
etc.

Other applicationsLive scoresReal-time notificationsInteractive gamesCollaborative appsLive user analyticsetc.

Слайд 9Standard solutions
Frequent Polling
Long polling
Server-Sent events (HTML5)
WebSocket (HTML5)

Standard solutionsFrequent PollingLong pollingServer-Sent events (HTML5)WebSocket (HTML5)

Слайд 10Polling
Get updates frequently using Ajax requests

Pros:
---
Cons:
Delay in results
Wastes bandwidth &

latency

PollingGet updates frequently using Ajax requestsPros:---Cons:Delay in resultsWastes bandwidth & latency

Слайд 11Long polling
Similar to usual polling (Ajax requests)
Request waits longer (1-2

minutes)

Pros:
Lower load on server
No delays
Cons:
Consumes server threads & connection resources

Long pollingSimilar to usual polling (Ajax requests)Request waits longer (1-2 minutes)Pros:Lower load on serverNo delaysCons:Consumes server threads

Слайд 12Server-Sent events
HTML5, works over HTTP
EventSource JavaScript API
Content-type: text/event-stream

Pros:
No need to

reconnect
No need in a special protocol or server implementation
Cons:
Works in

server-t0-client direction


Server-Sent eventsHTML5, works over HTTPEventSource JavaScript APIContent-type: text/event-streamPros:No need to reconnectNo need in a special protocol or

Слайд 13WebSocket
HTML5, new protocol (ws:// and wss://) on top of TCP


Pros:
Full-duplex

persistent connection (both ways)
Cons:
Require Web Socket protocol support on client

(IE10)
Require Web Socket protocol support on server (IIS8)
WebSocketHTML5, new protocol (ws:// and wss://) on top of TCPPros:Full-duplex persistent connection (both ways)Cons:Require Web Socket protocol

Слайд 14What to do?

What to do?

Слайд 15Superman SignalR to the rescue!

Superman SignalR to the rescue!

Слайд 16Authors
David Fowler
Damian Edwards

AuthorsDavid FowlerDamian Edwards

Слайд 17What is SignalR?
Official MS technology to build real-time multi-user ASP.NET

applications: http://signalr.net/
Out-of-box solution that consists of server and client side
Abstraction

over the set of transports
Open-source solution available on GitHub that can be installed via NuGet
What is SignalR?Official MS technology to build real-time multi-user ASP.NET applications: http://signalr.net/Out-of-box solution that consists of server

Слайд 18Transports priority

Transports priority

Слайд 19Architecture

Architecture

Слайд 20Hubs
High-level API
Similar to Controller (actions, thread per call)

HubsHigh-level APISimilar to Controller (actions, thread per call)

Слайд 21Supported scenarios
Client calling the server
Server calling clients (all, group, one)
State

round-tripping between client and server
Binding complex objects (JSON)
Detecting connect, disconnect

and reconnect clients
Broadcasting from outside of a Hub
Async scenarios (return Task/Task to client)


Supported scenariosClient calling the serverServer calling clients (all, group, one)State round-tripping between client and serverBinding complex objects

Слайд 22Server calling the client
dynamic Clients property
JSON serialization

Server calling the clientdynamic Clients propertyJSON serialization

Слайд 23Managing Groups
Add/remove connections to groups

Managing GroupsAdd/remove connections to groups

Слайд 24Broadcasting from outside
Notify clients from another server-side code

Broadcasting from outsideNotify clients from another server-side code

Слайд 25JavaScript client
$.connection.hub
connection for all hubs (url points to /signalr)
$.connection.hub.id
client id

for the hub connection
$.connection.hub.start()
starts the connection for all hubs
$.connection.{hubname}
access a

client side hub from the generated proxy
$.connection.hub.logging
set to true to enable logging
JavaScript client$.connection.hubconnection for all hubs (url points to /signalr)$.connection.hub.idclient id for the hub connection$.connection.hub.start()starts the connection for

Слайд 26Exposing methods on the client
The JavaScript client can declare methods

that the server can invoke:

myHub.{method} = callback
declares a function the

server can invoke.
method - name of the client side method
callback - function to execute when the server invokes the method


Exposing methods on the clientThe JavaScript client can declare methods that the server can invoke:myHub.{method} = callbackdeclares

Слайд 27JavaScript example

JavaScript example

Слайд 29Configuring SignalR
Set in IConfigurationManager:

Configuring SignalRSet in IConfigurationManager:

Слайд 30SignalR extensibility
Pluggable interfaces in SignalR:









You can even replace IDependencyResolver

SignalR extensibilityPluggable interfaces in SignalR:You can even replace IDependencyResolver

Слайд 31SignalR and web farm
Available now:
Azure Service Bus
Windows Server Service Bus
SQL

Server
Redis

Coming:
NServiceBus
SQL QNS
etc.

SignalR and web farmAvailable now:Azure Service BusWindows Server Service BusSQL ServerRedisComing:NServiceBusSQL QNSetc.

Слайд 32SignalR over Redis
Step 1
Download and install Redis as Windows service
Step

2
Install-Package SignalR.Redis
Step 3

SignalR over RedisStep 1Download and install Redis as Windows serviceStep 2Install-Package SignalR.RedisStep 3

Слайд 33Materials
https://github.com/SignalR
http://jabbr.net
http://www.hanselman.com/blog/CategoryView.aspx?category=SignalR
http://www.asp.net/vnext/overview/signalr/signalr-and-web-sockets
http://merle-amber.blogspot.com/2012/11/real-time-aspnet-signalr.html

Materialshttps://github.com/SignalRhttp://jabbr.nethttp://www.hanselman.com/blog/CategoryView.aspx?category=SignalRhttp://www.asp.net/vnext/overview/signalr/signalr-and-web-socketshttp://merle-amber.blogspot.com/2012/11/real-time-aspnet-signalr.html

Слайд 34Thanks for listening!
merle-amber.blogspot.com
@konduforov


31337

Thanks for listening!merle-amber.blogspot.com@konduforov31337

Обратная связь

Если не удалось найти и скачать доклад-презентацию, Вы можете заказать его на нашем сайте. Мы постараемся найти нужный Вам материал и отправим по электронной почте. Не стесняйтесь обращаться к нам, если у вас возникли вопросы или пожелания:

Email: Нажмите что бы посмотреть 

Что такое TheSlide.ru?

Это сайт презентации, докладов, проектов в PowerPoint. Здесь удобно  хранить и делиться своими презентациями с другими пользователями.


Для правообладателей

Яндекс.Метрика