SlideShare una empresa de Scribd logo
1 de 11
Local Touch – Global Reach




  Intro to SignalR + Awesome Mobile Possibilities!



Samidip Basu
Solutions Lead | MSFT Mobility
Email: Samidip.Basu@us.sogeti.com
Twitter: @samidip
Blog: http://samidipbasu.com

Sogeti USA
8425 Pulsar Place, Suite 300 | Columbus, OH 43240.
www.us.sogeti.com




                                                                   www.us.sogeti.com
Why do we need real-time?
New email

Twitter/Facebook updates

Stock Ticker/Live Auctions

Game Scores

Real-time Notifications

Turn-by-Turn or Shooter Games

Collaboration

Progress Bars

And obviously, Chat
Existing Technologies
HTTP – purely Request/Response protocol

Internet – stateless; servers don’t call your app back

Consumption model .. But we’ve learnt tricks

Periodic/Ajax Polling – not real-time, bandwidth misuse




                                                Image courtesy
                                                @maartenballiauw
Existing Technologies ..
Contd. plugins like SL/Flash – to access sockets
    Use

        Native Web Sockets (Magic Unicorn world) – but low level & support flaky

        Long Polling – server does not respond unless X happens,
                      client polls after data receive or time-out




        Forever Frame (execute script blocks from server in iFrame)

        Server sent Events (Push or Stream from server)

                                                      Image courtesy
                                                      @maartenballiauw
Enter SignalR
An async, persistent connection/signalling library for .NET over HTTP ... aids in
   building real time, multi-user connected applications.

Persistent client-server connection over best transport .. Abstracts away the
   transport layer.

From ASP.NET team-members (Damian Edwards & David Fowler) ..
   Not officially MSFT product, but OSS Boom! 

https://github.com/SignalR/SignalR
http://jabbr.net/#/rooms/signal
http://shootr.signalr.net/

SignalR is broken up into a few packages on NuGet:
    SignalR - Package for SignalR.Server and SignalR.Js
    SignalR.Server - Server components needed for SignalR endpoints
    SignalR.Js - Javascript client for SignalR
    SignalR.Client - .NET client for SignalR
    SignalR.WP7, SignalR.WinRT, SignalR.Silverlight – For the cool folks 
    SignalR.WebSockets - WebSocket Transport for SignalR
Live Demos & Walkthrough
Client calls server; Server calls client; seamlessly – Whoa!

No polling, at least in our code

Low level – PersistentConnection
             more control

Abstraction – Hub
              easier to use
              like spokes on a wheel, broadcasting

Server maintains Clients .. Broadcast to all, group or individual clients

Built-in Retry logic if transport fails

Supports scaling out to web farms - backplane support through Service
  Bus or Redis (in memory DB) to pump messages between multiple
  servers
Where does this fit?
Other technologies have solved this problem

Socket.IO is a client-side Jscript library that talks to node.js

Nowjs supports namespace sync between client-server

Primary SignalR advantages

    → Simplicity & ease of use
    → Works natively in .NET
    → Works out of browser
    → Supports Web Sockets for best transport
      [ASP.NET 4.5/IIS 8 on Win8 only]
       WebSocket is a web technology providing for multiplexing bi-directional, full-duplex
         communications channels over a single TCP connection. Still being standardized.
    → Works on other platforms, specially mobile
SignalR Client for iOS




http://dyknow.github.com/SignalR-ObjC/
SignalR Client for Mono




http://blog.rthand.com/post/2012/03/14/SignalR-client-on-Mono-for-Android.aspx
Local Touch – Global Reach




Questions?

Thank you !!

@samidip




                             www.us.sogeti.com

Más contenido relacionado

Más de Sam Basu

Kendo UI 101
Kendo UI 101Kendo UI 101
Kendo UI 101
Sam Basu
 
Telerik AppBuilder 101
Telerik AppBuilder 101Telerik AppBuilder 101
Telerik AppBuilder 101
Sam Basu
 
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
 
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
 

Más de Sam Basu (20)

Surfing in Maui
Surfing in MauiSurfing in Maui
Surfing in Maui
 
Modern Cross-Platform Dev with .NET 6
Modern Cross-Platform Dev with .NET 6Modern Cross-Platform Dev with .NET 6
Modern Cross-Platform Dev with .NET 6
 
Conversational Bots
Conversational BotsConversational Bots
Conversational Bots
 
Real Time Apps with SignalR Core
Real Time Apps with SignalR CoreReal Time Apps with SignalR Core
Real Time Apps with SignalR Core
 
State of Mobile Development
State of Mobile DevelopmentState of Mobile Development
State of Mobile Development
 
.NET Today & Tomorrow @ Beer City Code
.NET Today & Tomorrow @ Beer City Code.NET Today & Tomorrow @ Beer City Code
.NET Today & Tomorrow @ Beer City Code
 
Essential Tools for Xamarin Developers
Essential Tools for Xamarin DevelopersEssential Tools for Xamarin Developers
Essential Tools for Xamarin Developers
 
Modern Web Tour
Modern Web TourModern Web Tour
Modern Web Tour
 
Flying High with Xamarin!
Flying High with Xamarin!Flying High with Xamarin!
Flying High with Xamarin!
 
Xamarin Roadshow
Xamarin RoadshowXamarin Roadshow
Xamarin Roadshow
 
Flying High with Xamarin
Flying High with XamarinFlying High with Xamarin
Flying High with Xamarin
 
Modern .NET Apps - Codestock
Modern .NET Apps - CodestockModern .NET Apps - Codestock
Modern .NET Apps - Codestock
 
A Lap around ASP.NET 5 - Codestock
A Lap around ASP.NET 5 - CodestockA Lap around ASP.NET 5 - Codestock
A Lap around ASP.NET 5 - Codestock
 
Modern .NET Apps - Telerik Webinar
Modern .NET Apps - Telerik WebinarModern .NET Apps - Telerik Webinar
Modern .NET Apps - Telerik Webinar
 
Modern .NET Apps Workshop
Modern .NET Apps WorkshopModern .NET Apps Workshop
Modern .NET Apps Workshop
 
Cloud Backend for Mobile Apps
Cloud Backend for Mobile AppsCloud Backend for Mobile Apps
Cloud Backend for Mobile Apps
 
Kendo UI 101
Kendo UI 101Kendo UI 101
Kendo UI 101
 
Telerik AppBuilder 101
Telerik AppBuilder 101Telerik AppBuilder 101
Telerik AppBuilder 101
 
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!
 
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!
 

SignalR + Mobile Possibilities (CodeMash)

  • 1. Local Touch – Global Reach Intro to SignalR + Awesome Mobile Possibilities! Samidip Basu Solutions Lead | MSFT Mobility Email: Samidip.Basu@us.sogeti.com Twitter: @samidip Blog: http://samidipbasu.com Sogeti USA 8425 Pulsar Place, Suite 300 | Columbus, OH 43240. www.us.sogeti.com www.us.sogeti.com
  • 2.
  • 3. Why do we need real-time? New email Twitter/Facebook updates Stock Ticker/Live Auctions Game Scores Real-time Notifications Turn-by-Turn or Shooter Games Collaboration Progress Bars And obviously, Chat
  • 4. Existing Technologies HTTP – purely Request/Response protocol Internet – stateless; servers don’t call your app back Consumption model .. But we’ve learnt tricks Periodic/Ajax Polling – not real-time, bandwidth misuse Image courtesy @maartenballiauw
  • 5. Existing Technologies .. Contd. plugins like SL/Flash – to access sockets Use Native Web Sockets (Magic Unicorn world) – but low level & support flaky Long Polling – server does not respond unless X happens, client polls after data receive or time-out Forever Frame (execute script blocks from server in iFrame) Server sent Events (Push or Stream from server) Image courtesy @maartenballiauw
  • 6. Enter SignalR An async, persistent connection/signalling library for .NET over HTTP ... aids in building real time, multi-user connected applications. Persistent client-server connection over best transport .. Abstracts away the transport layer. From ASP.NET team-members (Damian Edwards & David Fowler) .. Not officially MSFT product, but OSS Boom!  https://github.com/SignalR/SignalR http://jabbr.net/#/rooms/signal http://shootr.signalr.net/ SignalR is broken up into a few packages on NuGet: SignalR - Package for SignalR.Server and SignalR.Js SignalR.Server - Server components needed for SignalR endpoints SignalR.Js - Javascript client for SignalR SignalR.Client - .NET client for SignalR SignalR.WP7, SignalR.WinRT, SignalR.Silverlight – For the cool folks  SignalR.WebSockets - WebSocket Transport for SignalR
  • 7. Live Demos & Walkthrough Client calls server; Server calls client; seamlessly – Whoa! No polling, at least in our code Low level – PersistentConnection more control Abstraction – Hub easier to use like spokes on a wheel, broadcasting Server maintains Clients .. Broadcast to all, group or individual clients Built-in Retry logic if transport fails Supports scaling out to web farms - backplane support through Service Bus or Redis (in memory DB) to pump messages between multiple servers
  • 8. Where does this fit? Other technologies have solved this problem Socket.IO is a client-side Jscript library that talks to node.js Nowjs supports namespace sync between client-server Primary SignalR advantages → Simplicity & ease of use → Works natively in .NET → Works out of browser → Supports Web Sockets for best transport [ASP.NET 4.5/IIS 8 on Win8 only] WebSocket is a web technology providing for multiplexing bi-directional, full-duplex communications channels over a single TCP connection. Still being standardized. → Works on other platforms, specially mobile
  • 9. SignalR Client for iOS http://dyknow.github.com/SignalR-ObjC/
  • 10. SignalR Client for Mono http://blog.rthand.com/post/2012/03/14/SignalR-client-on-Mono-for-Android.aspx
  • 11. Local Touch – Global Reach Questions? Thank you !! @samidip www.us.sogeti.com