SlideShare ist ein Scribd-Unternehmen logo
1 von 40
SignalR


  Eyal Vardi
  CEO E4D Solutions LTD
  Microsoft MVP Visual C#
  blog: www.eVardi.com
Expert Days 2012
                                                                                 




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Agenda
           SignalR Server Side API

           SignalR JavaScript API

           SignalR Client .NET API

           SignalR Internals

           SignalR Extensibility




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Sever Side




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
What is SignalR?
           SignalR is an asynchronous signaling library
            for ASP.NET, To help build real-time multi-
            user web application.
           SignalR is a complete client- and server-side
            solution with JS on client and ASP.NET on the
            back end to create these kinds of applications.




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
More Details on SignalR
           SignalR is broken up into a few package on
            NuGet:
                  SignalR - A meta package that brings in SignalR.Server and
                                 SignalR.Js (you should install this)

                  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 dependeny resolver for SignalR



© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Hub Class
           Hubs provide a higher level RPC
            framework over a PersistentConnection.
           SignalR will handle the binding of complex
            objects and arrays of objects automatically.


                       [HubName("Chat")]         Callable from                   the client
                       public class Chat : Hub
                       {
                            public string Send(string message)
                            {
                                return message;                                  Deserialization
                            }
                       }




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Hub API
           Hubs are per call, that is, each call from the
            client to the hub will create a new hub
            instance. So don't setup static event handlers
            in hub methods.




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Server Calling The Client
           To call client event/methods from the server
            use the Clients property.
           Parameters passed to the method will be
            JSON serialized before being sent to the client

                       [HubName("Chat")]
                       public class Chat : Hub
                       {
                            public void Send(string message)
                            {
                                // Call the addMessage method on all clients
                               Clients.addMessage(message);
                            }
                       }




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Calling on Specific Connections
            There are some cases where we want to send
             a message to specific clients or groups. We
             can use the indexer on the Clients object to
             specify a connection id.


                      [HubName("Chat")]
                      public class Chat : Hub
                      {
                           public void Send(string message)
                           {
                              Clients[Context.ConnectionId].addMessage(message);
                           }
                      }




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Managing Groups
           You can add connections to groups and send
            messages to particular groups.
           You may also return Task/Task<T> from a hub
            if you need to do async work.
                    public class MyHub : Hub, IDisconnect
                    {
                            public Task Join() {
                                return Groups.Add(Context.ConnectionId, "foo");
                            }

                             public Task Send(string message) {
                                 return Clients["foo"].addMessage(message);
                             }

                             public Task Disconnect() {
                                 return Clients["foo"].leave(Context.ConnectionId);
                             }
                    }


© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
State Between Client & Server
           Any state sent from the client can be
            accessed via the Caller property.
           You can also set client side state just by
            setting any property on Caller.

                      [HubName("Chat")]
                      public class Chat : Hub
                      {
                           public void Send(string message)
                           {
                              // Access the id property set from the client.
                              string id = Caller.id;

                                 // Set a property on the client state
                                 Caller.name = "SignalR";
                             }
                      }

© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Client Events in Server Side
             To detect disconnects when using hubs,
              implement the IDisconnect interface.
             To detect connects and reconnects,
              implement Iconnected.

       public class Status : Hub, IDisconnect, IConnected
          {
              public Task Disconnect() {
                  return Clients.leave(Context.ConnectionId, DateTime.Now.ToString());
              }

               public Task Connect() {
                   return Clients.joined(Context.ConnectionId, DateTime.Now.ToString());
               }

               public Task Reconnect(IEnumerable<string> groups) {
                   return Clients.rejoined(Context.ConnectionId, DateTime.Now.ToString());
               }
          }



© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Broadcasting From Outside of a Hub

           Sometimes you have some arbitrary code in
            an application that you want to be able to
            notify all clients connected when some event
            occurs.

       public class Notifier
          {
              public static void Say(string message)
              {
                  var context = GlobalHost.ConnectionManager.GetHubContext<MyHub>();
                  context.Clients.say(message);
              }
          }




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Hub Routing
           No need to specify a route for the hub as they
            are automatically accessible over a special url
            (/signalr)

                 public class MvcApplication : System.Web.HttpApplication
                 {
                    protected void Application_Start()
                    {
                        RouteTable.Routes.MapHubs("~/signalr2");
                    }
                 }




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Client Side




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
JavaScript Client
    <script src="Scripts/jquery.signalR-0.5.3.min.js" type="text/javascript"></script>
    <script src="/signalr/hubs" type="text/javascript"></script>



       <script type="text/javascript">
              $(function () {
                  // Proxy created on the fly
                  var chat = $.connection.chat;

                      // Declare a function on the chat hub so the server can invoke it
                      chat.addMessage = function (message) {
                          $('#messages').append('<li>' + message + '</li>');
                      };

                      $("#broadcast").click(function () {
                          // Call the chat method on the server
                          chat.send($('#msg').val());
                      });

                      // Start the connection
                      $.connection.hub.start();
              });
       </script>

© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
JavaScript API
           $.connection.hub
                  The connection for all hubs (url points to /signalr). Returns a
                   connection

           $.connection.hub.id
                  The client id for the hub connection.

           $.connection.hub.logging
                  Set to true to enable logging. Default is false

           $.connection.hub.start()
                  Starts the connection for all hubs.



© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Exposing Methods For The Server

           The JavaScript client can declare methods
            that the server can invoke.

                                 myHub.{method} = callback
       Method             - name of the client side method.

       Callback - A function to execute when the server invokes the
                   method.

       NOTE: if you misspell you will NOT get any warning or
              notifications even when logging is enabled.

       NOTE: Unlike the name change in myHub, the function names here at
              the same as you call in Server code.


© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Invoking methods on the server
           The proxy will generate methods on each hub
            for the associated server methods.
                  Returns jQuery deferred.
                  NOTE: Method names will be camel cased similarly to hub
                   names.

                          myHub.someMethod()
                               .done(function(result) {})
                               .fail(function(error) {});




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Round-Tripping State
           To set state on the hub. Just assign values to
            properties on the hub object.
                  myHub.name = “E4D”

           Whenever a call to the hub the state will be
            sent to the server.




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Cross Domain Support
           You can talk to SignalR servers either using
            websockets, cors enabled longpolling (not
            supported by all browsers) or jsonp
            longpolling.
           Cross domain urls are auto detected. We'll use
            xhr by default if the client (your browser)
            supports it.

                      $.connection.hub.url = 'http://localhost:8081/signalr';

                      $.connection.hub.start();




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Cross Domain Support (JSONP)
           Cross domain fall back to jsonp longpolling.
           To use jsonp longpolling, you can specify that
            option explicitly:

                      $.connection.hub.url = 'http://localhost:8081/signalr';

                      $.connection.hub.start({ jsonp: true });




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
$.connection.hub.logging = true;

  var myHub       = $.connection.myHub;
  myHub.someState = "SomeValue";

  function connectionReady() {
       alert("Done calling first hub serverside-function");
  };

  myHub.SomeClientFunction = function () {
       alert("serverside called 'Clients.SomeClientFunction()'");
  };

  $.connection.hub.error(function () {
        alert("An error occured");
  });

  $.connection.hub.start()
                  .done(function () {
                         myHub.SomeFunction(SomeParam) //e.g. a login or init
                              .done(connectionReady);
                  })
                  .fail(function () { alert("Could not Connect!"); });


© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Client JavaScript


© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
.Net Client


     // Connect to the service
     var hubConnection = new HubConnection("http://localhost/mysite");

     // Create a proxy to the chat service
     var chat = hubConnection.CreateProxy("chat");

     // Print the message when it comes in
     chat.On("addMessage", message => Console.WriteLine(message));

     // Start the connection
     hubConnection.Start().Wait();

     string line = null;
     while ((line = Console.ReadLine()) != null)
     {
          // Send a message to the server
          chat.Invoke("Send", line).Wait();
     }

© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
SignalR Internals




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Default Start Point
              The AspNetBootstrapper class initializes the
               Asp.Net hosting pipeline with HubDispatcher

      [assembly: PreApplicationStartMethod(typeof(AspNetBootstrapper), "Initialize")]

      namespace SignalR.Hosting.AspNet
      {
          public static class AspNetBootstrapper
          {
              ...
              // Initializes the ASP.NET host and sets up the default hub route (~/signalr).
              public static void Initialize()
              {                                             Add Route
                 ...
                 RouteTable.Routes.MapHubs();
                 ...
              }

                private static void OnAppDomainShutdown() { ... }
           }
      }


© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
MapHubs Extension Methods
           The MapHubs does two things :
                  Register the AspNetAssemblyLocator
                  Build the route class for SignalR

          var locator = new Lazy<IAssemblyLocator>(() => new AspNetAssemblyLocator());
          resolver.Register(typeof(IAssemblyLocator), () => locator.Value);

          var route = new Route(routeUrl, new HubDispatcherRouteHandler(url, resolver));




           routeUrl = "~/signalr /{*operation}"




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
HubDispatcherRouteHandler
       public IHttpHandler GetHttpHandler(RequestContext requestContext)
       {
           var dispatcher = new HubDispatcher(_url);
           return new AspNetHandler(_resolver, dispatcher);
       }




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Persistent Connection




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
HubDispatcher
       public override Task ProcessRequestAsync(HostContext context)
       {
           // Generate the proxy
           if (context.Request.Url.LocalPath.EndsWith("/hubs",StringComparison.OrdinalIgnoreCase))
           {
               context.Response.ContentType = "application/x-javascript";
               return context.Response.EndAsync(_proxyGenerator.GenerateProxy(_url));
           }
           ...
           return base.ProcessRequestAsync(context);
       }


      protected override Task OnReceivedAsync(IRequest req, string connId, string data)
      {
             ...
            // 1.    Create the hub
            ...
            // 2.    Resolve the method
            ...
            // 3.    Resolving the state
            ...
            // 4.    Invoke the method
            ...
      }
© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
SignalR Extensibility




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Low Level Connection
           You can add your own route

     RouteTable.Routes.MapConnection<MyConnection>("echo", "echo/{*operation}");

       public class MyConnection : PersistentConnection
          {
              protected override Task OnReceivedAsync(string clientId, string data)
              {
                  // Broadcast data to all clients
                  return global::SignalR.Connection.Broadcast(data);
              }
          }




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
SignalR Extensibility
           SignalR is built with dependency injection in
            mind.




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Configuring SignalR
          ConnectionTimeout
                 The amount of time to leave a connection open before timing
                  out. Default is 110 seconds.
          DisconnectTimeout
                 The amount of time to wait after a connection goes away
                  before raising the disconnect event. Default is 20 seconds.
          HeartBeatInterval
                 The interval for checking the state of a connection.
                  Default is 10 seconds.
          KeepAlive
                 The amount of time to wait before sending a keep alive packet
                  over an idle connection. Set to null to disable keep alive. This
                  is set to 30 seconds by default. When this is on, the
                  ConnectionTimeout will have no effect.

© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Replacing individual components

           You can replace individual parts of SignalR
            without replacing the DependencyResolver by
            calling.

     GlobalHost
      .DependencyResolver
      .Register( typeof(IConnectionIdFactory), () => new CustomIdFactory() );




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Replaceable Components
           The following lists the pluggable interfaces in
            SignalR.

     Interfaces                                    Description
     IMessageBus                                   Message bus.
     IConnectionIdGenerator                        Generates connection ids.
     IAssemblyLocator                              Locates assemblies to find hubs in.
     IJavaScriptProxyGenerator                     Generates the client proxy for hubs.
     IJavaScriptMinifier                           Allows the dynamic javascript proxy to be minified.
     IJsonSerializer                               Used to serialize and deserialze outgoing/incoming data.




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Server Side




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
Client Side




© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

Weitere ähnliche Inhalte

Was ist angesagt?

Signalr with ASP.Net part2
Signalr with ASP.Net part2Signalr with ASP.Net part2
Signalr with ASP.Net part2Esraa Ammar
 
Clean up this mess - API Gateway & Service Discovery in .NET
Clean up this mess - API Gateway & Service Discovery in .NETClean up this mess - API Gateway & Service Discovery in .NET
Clean up this mess - API Gateway & Service Discovery in .NETMarcin Tyborowski
 
Enjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIEnjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIKevin Hazzard
 
Architecting &Building Scalable Secure Web API
Architecting &Building Scalable Secure Web APIArchitecting &Building Scalable Secure Web API
Architecting &Building Scalable Secure Web APISHAKIL AKHTAR
 
Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1KlaraOrban
 
Web Real-time Communications
Web Real-time CommunicationsWeb Real-time Communications
Web Real-time CommunicationsAlexei Skachykhin
 
Building Fast and Scalable Persistence Layers with Spring Data JPA
Building Fast and Scalable Persistence Layers with Spring Data JPABuilding Fast and Scalable Persistence Layers with Spring Data JPA
Building Fast and Scalable Persistence Layers with Spring Data JPAVMware Tanzu
 
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...Amazon Web Services
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gatewayaws-marketing-il
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Coremohamed elshafey
 
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Masoud Kalali
 
Server-Sent Events in Action
Server-Sent Events in ActionServer-Sent Events in Action
Server-Sent Events in ActionAndrei Rusu
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical ApproachMadhaiyan Muthu
 
Developing and Hosting SOAP Based Services
Developing and Hosting SOAP Based ServicesDeveloping and Hosting SOAP Based Services
Developing and Hosting SOAP Based ServicesStephenKardian
 
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...Amazon Web Services
 
10 Tricks and Tips for WCF
10 Tricks and Tips for WCF10 Tricks and Tips for WCF
10 Tricks and Tips for WCFBarry Dorrans
 
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIsAmazon Web Services
 
AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018Yoel Spotts
 

Was ist angesagt? (20)

SignalR Overview
SignalR OverviewSignalR Overview
SignalR Overview
 
Signalr with ASP.Net part2
Signalr with ASP.Net part2Signalr with ASP.Net part2
Signalr with ASP.Net part2
 
Clean up this mess - API Gateway & Service Discovery in .NET
Clean up this mess - API Gateway & Service Discovery in .NETClean up this mess - API Gateway & Service Discovery in .NET
Clean up this mess - API Gateway & Service Discovery in .NET
 
Enjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIEnjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web API
 
Architecting &Building Scalable Secure Web API
Architecting &Building Scalable Secure Web APIArchitecting &Building Scalable Secure Web API
Architecting &Building Scalable Secure Web API
 
Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1
 
Web Real-time Communications
Web Real-time CommunicationsWeb Real-time Communications
Web Real-time Communications
 
Building Fast and Scalable Persistence Layers with Spring Data JPA
Building Fast and Scalable Persistence Layers with Spring Data JPABuilding Fast and Scalable Persistence Layers with Spring Data JPA
Building Fast and Scalable Persistence Layers with Spring Data JPA
 
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gateway
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
 
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
 
Server-Sent Events in Action
Server-Sent Events in ActionServer-Sent Events in Action
Server-Sent Events in Action
 
Server side
Server sideServer side
Server side
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical Approach
 
Developing and Hosting SOAP Based Services
Developing and Hosting SOAP Based ServicesDeveloping and Hosting SOAP Based Services
Developing and Hosting SOAP Based Services
 
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
 
10 Tricks and Tips for WCF
10 Tricks and Tips for WCF10 Tricks and Tips for WCF
10 Tricks and Tips for WCF
 
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
 
AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018
 

Andere mochten auch

«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.NETAlessandro Giorgetti
 
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
 
SignalR for ASP.NET Developers
SignalR for ASP.NET DevelopersSignalR for ASP.NET Developers
SignalR for ASP.NET DevelopersShivanand Arur
 
Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture AppDynamics
 
Real Time Data Visualization using asp.net / SignalR + D3.js
Real Time Data Visualization using asp.net / SignalR + D3.jsReal Time Data Visualization using asp.net / SignalR + D3.js
Real Time Data Visualization using asp.net / SignalR + D3.jsSunny Sharma
 

Andere mochten auch (11)

SignalR
SignalRSignalR
SignalR
 
«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
 
SignalR
SignalRSignalR
SignalR
 
SignalR
SignalRSignalR
SignalR
 
Signal R 2015
Signal R 2015Signal R 2015
Signal R 2015
 
ELEIÇÕES 2012 - ASTORGA: Toninho 31123
 ELEIÇÕES 2012 - ASTORGA: Toninho 31123 ELEIÇÕES 2012 - ASTORGA: Toninho 31123
ELEIÇÕES 2012 - ASTORGA: Toninho 31123
 
Real time web with SignalR
Real time web with SignalRReal time web with SignalR
Real time web with SignalR
 
Real-time ASP.NET with SignalR
Real-time ASP.NET with SignalRReal-time ASP.NET with SignalR
Real-time ASP.NET with SignalR
 
SignalR for ASP.NET Developers
SignalR for ASP.NET DevelopersSignalR for ASP.NET Developers
SignalR for ASP.NET Developers
 
Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture
 
Real Time Data Visualization using asp.net / SignalR + D3.js
Real Time Data Visualization using asp.net / SignalR + D3.jsReal Time Data Visualization using asp.net / SignalR + D3.js
Real Time Data Visualization using asp.net / SignalR + D3.js
 

Ähnlich wie SignalR

Consul: Service Mesh for Microservices
Consul: Service Mesh for MicroservicesConsul: Service Mesh for Microservices
Consul: Service Mesh for MicroservicesArmonDadgar
 
Introduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshIntroduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshSiddhesh Bhobe
 
Asp.net mvc internals & extensibility
Asp.net mvc internals & extensibilityAsp.net mvc internals & extensibility
Asp.net mvc internals & extensibilityEyal Vardi
 
introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationredaxe12
 
Oop2008 RESTful services with GWT and Apache CXF
Oop2008 RESTful services with GWT and Apache CXFOop2008 RESTful services with GWT and Apache CXF
Oop2008 RESTful services with GWT and Apache CXFAdrian Trenaman
 
The use of Symfony2 @ Overblog
The use of Symfony2 @ OverblogThe use of Symfony2 @ Overblog
The use of Symfony2 @ OverblogXavier Hausherr
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile ServicesSasha Goldshtein
 
Asp.Net Mvc Internals &amp; Extensibility
Asp.Net Mvc Internals &amp; ExtensibilityAsp.Net Mvc Internals &amp; Extensibility
Asp.Net Mvc Internals &amp; ExtensibilityEyal Vardi
 
Fiware IoT_IDAS_intro_ul20_v2
Fiware IoT_IDAS_intro_ul20_v2Fiware IoT_IDAS_intro_ul20_v2
Fiware IoT_IDAS_intro_ul20_v2FIWARE
 
solc-verify: A Modular Verifier for Solidity Smart Contracts
solc-verify: A Modular Verifier for Solidity Smart Contractssolc-verify: A Modular Verifier for Solidity Smart Contracts
solc-verify: A Modular Verifier for Solidity Smart ContractsAkos Hajdu
 
Java client socket-20070327
Java client socket-20070327Java client socket-20070327
Java client socket-20070327Tsu-Fen Han
 
Architecture your android_application
Architecture your android_applicationArchitecture your android_application
Architecture your android_applicationMark Brady
 
Creating a Java Internet of Things Gateway
Creating a Java Internet of Things GatewayCreating a Java Internet of Things Gateway
Creating a Java Internet of Things GatewayEurotech
 
Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Sujee Maniyam
 
以Device Shadows與Rules Engine串聯實體世界
以Device Shadows與Rules Engine串聯實體世界以Device Shadows與Rules Engine串聯實體世界
以Device Shadows與Rules Engine串聯實體世界Amazon Web Services
 
Networking and Data Access with Eqela
Networking and Data Access with EqelaNetworking and Data Access with Eqela
Networking and Data Access with Eqelajobandesther
 
Prism Navigation
Prism NavigationPrism Navigation
Prism NavigationEyal Vardi
 

Ähnlich wie SignalR (20)

Consul: Service Mesh for Microservices
Consul: Service Mesh for MicroservicesConsul: Service Mesh for Microservices
Consul: Service Mesh for Microservices
 
Models
ModelsModels
Models
 
Introduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshIntroduction To Dot Net Siddhesh
Introduction To Dot Net Siddhesh
 
Asp.net mvc internals & extensibility
Asp.net mvc internals & extensibilityAsp.net mvc internals & extensibility
Asp.net mvc internals & extensibility
 
introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundation
 
Oop2008 RESTful services with GWT and Apache CXF
Oop2008 RESTful services with GWT and Apache CXFOop2008 RESTful services with GWT and Apache CXF
Oop2008 RESTful services with GWT and Apache CXF
 
The use of Symfony2 @ Overblog
The use of Symfony2 @ OverblogThe use of Symfony2 @ Overblog
The use of Symfony2 @ Overblog
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile Services
 
Asp.Net Mvc Internals &amp; Extensibility
Asp.Net Mvc Internals &amp; ExtensibilityAsp.Net Mvc Internals &amp; Extensibility
Asp.Net Mvc Internals &amp; Extensibility
 
Fiware IoT_IDAS_intro_ul20_v2
Fiware IoT_IDAS_intro_ul20_v2Fiware IoT_IDAS_intro_ul20_v2
Fiware IoT_IDAS_intro_ul20_v2
 
Corba model ppt
Corba model pptCorba model ppt
Corba model ppt
 
solc-verify: A Modular Verifier for Solidity Smart Contracts
solc-verify: A Modular Verifier for Solidity Smart Contractssolc-verify: A Modular Verifier for Solidity Smart Contracts
solc-verify: A Modular Verifier for Solidity Smart Contracts
 
Java client socket-20070327
Java client socket-20070327Java client socket-20070327
Java client socket-20070327
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
 
Architecture your android_application
Architecture your android_applicationArchitecture your android_application
Architecture your android_application
 
Creating a Java Internet of Things Gateway
Creating a Java Internet of Things GatewayCreating a Java Internet of Things Gateway
Creating a Java Internet of Things Gateway
 
Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)
 
以Device Shadows與Rules Engine串聯實體世界
以Device Shadows與Rules Engine串聯實體世界以Device Shadows與Rules Engine串聯實體世界
以Device Shadows與Rules Engine串聯實體世界
 
Networking and Data Access with Eqela
Networking and Data Access with EqelaNetworking and Data Access with Eqela
Networking and Data Access with Eqela
 
Prism Navigation
Prism NavigationPrism Navigation
Prism Navigation
 

Mehr von Eyal Vardi

Smart Contract
Smart ContractSmart Contract
Smart ContractEyal Vardi
 
Rachel's grandmother's recipes
Rachel's grandmother's recipesRachel's grandmother's recipes
Rachel's grandmother's recipesEyal Vardi
 
Performance Optimization In Angular 2
Performance Optimization In Angular 2Performance Optimization In Angular 2
Performance Optimization In Angular 2Eyal Vardi
 
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Eyal Vardi
 
Angular 2 NgModule
Angular 2 NgModuleAngular 2 NgModule
Angular 2 NgModuleEyal Vardi
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xEyal Vardi
 
Angular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time CompilationAngular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time CompilationEyal Vardi
 
Routing And Navigation
Routing And NavigationRouting And Navigation
Routing And NavigationEyal Vardi
 
Angular 2 Architecture
Angular 2 ArchitectureAngular 2 Architecture
Angular 2 ArchitectureEyal Vardi
 
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.xAngular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.xEyal Vardi
 
Angular 2.0 Views
Angular 2.0 ViewsAngular 2.0 Views
Angular 2.0 ViewsEyal Vardi
 
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0Eyal Vardi
 
Template syntax in Angular 2.0
Template syntax in Angular 2.0Template syntax in Angular 2.0
Template syntax in Angular 2.0Eyal Vardi
 
Http Communication in Angular 2.0
Http Communication in Angular 2.0Http Communication in Angular 2.0
Http Communication in Angular 2.0Eyal Vardi
 
Angular 2.0 Dependency injection
Angular 2.0 Dependency injectionAngular 2.0 Dependency injection
Angular 2.0 Dependency injectionEyal Vardi
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationAngular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationEyal Vardi
 
Async & Parallel in JavaScript
Async & Parallel in JavaScriptAsync & Parallel in JavaScript
Async & Parallel in JavaScriptEyal Vardi
 
Angular 2.0 Pipes
Angular 2.0 PipesAngular 2.0 Pipes
Angular 2.0 PipesEyal Vardi
 
Angular 2.0 forms
Angular 2.0 formsAngular 2.0 forms
Angular 2.0 formsEyal Vardi
 

Mehr von Eyal Vardi (20)

Why magic
Why magicWhy magic
Why magic
 
Smart Contract
Smart ContractSmart Contract
Smart Contract
 
Rachel's grandmother's recipes
Rachel's grandmother's recipesRachel's grandmother's recipes
Rachel's grandmother's recipes
 
Performance Optimization In Angular 2
Performance Optimization In Angular 2Performance Optimization In Angular 2
Performance Optimization In Angular 2
 
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
 
Angular 2 NgModule
Angular 2 NgModuleAngular 2 NgModule
Angular 2 NgModule
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
 
Angular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time CompilationAngular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time Compilation
 
Routing And Navigation
Routing And NavigationRouting And Navigation
Routing And Navigation
 
Angular 2 Architecture
Angular 2 ArchitectureAngular 2 Architecture
Angular 2 Architecture
 
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.xAngular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.x
 
Angular 2.0 Views
Angular 2.0 ViewsAngular 2.0 Views
Angular 2.0 Views
 
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
 
Template syntax in Angular 2.0
Template syntax in Angular 2.0Template syntax in Angular 2.0
Template syntax in Angular 2.0
 
Http Communication in Angular 2.0
Http Communication in Angular 2.0Http Communication in Angular 2.0
Http Communication in Angular 2.0
 
Angular 2.0 Dependency injection
Angular 2.0 Dependency injectionAngular 2.0 Dependency injection
Angular 2.0 Dependency injection
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationAngular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
 
Async & Parallel in JavaScript
Async & Parallel in JavaScriptAsync & Parallel in JavaScript
Async & Parallel in JavaScript
 
Angular 2.0 Pipes
Angular 2.0 PipesAngular 2.0 Pipes
Angular 2.0 Pipes
 
Angular 2.0 forms
Angular 2.0 formsAngular 2.0 forms
Angular 2.0 forms
 

Kürzlich hochgeladen

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

SignalR

  • 1. SignalR Eyal Vardi CEO E4D Solutions LTD Microsoft MVP Visual C# blog: www.eVardi.com
  • 2. Expert Days 2012  © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 3. Agenda  SignalR Server Side API  SignalR JavaScript API  SignalR Client .NET API  SignalR Internals  SignalR Extensibility © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 4. Sever Side © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 5. What is SignalR?  SignalR is an asynchronous signaling library for ASP.NET, To help build real-time multi- user web application.  SignalR is a complete client- and server-side solution with JS on client and ASP.NET on the back end to create these kinds of applications. © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 6. More Details on SignalR  SignalR is broken up into a few package on NuGet:  SignalR - A meta package that brings in SignalR.Server and SignalR.Js (you should install this)  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 dependeny resolver for SignalR © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 7. Hub Class  Hubs provide a higher level RPC framework over a PersistentConnection.  SignalR will handle the binding of complex objects and arrays of objects automatically. [HubName("Chat")] Callable from the client public class Chat : Hub { public string Send(string message) { return message; Deserialization } } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 8. Hub API  Hubs are per call, that is, each call from the client to the hub will create a new hub instance. So don't setup static event handlers in hub methods. © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 9. Server Calling The Client  To call client event/methods from the server use the Clients property.  Parameters passed to the method will be JSON serialized before being sent to the client [HubName("Chat")] public class Chat : Hub { public void Send(string message) { // Call the addMessage method on all clients Clients.addMessage(message); } } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 10. Calling on Specific Connections  There are some cases where we want to send a message to specific clients or groups. We can use the indexer on the Clients object to specify a connection id. [HubName("Chat")] public class Chat : Hub { public void Send(string message) { Clients[Context.ConnectionId].addMessage(message); } } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 11. Managing Groups  You can add connections to groups and send messages to particular groups.  You may also return Task/Task<T> from a hub if you need to do async work. public class MyHub : Hub, IDisconnect { public Task Join() { return Groups.Add(Context.ConnectionId, "foo"); } public Task Send(string message) { return Clients["foo"].addMessage(message); } public Task Disconnect() { return Clients["foo"].leave(Context.ConnectionId); } } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 12. State Between Client & Server  Any state sent from the client can be accessed via the Caller property.  You can also set client side state just by setting any property on Caller. [HubName("Chat")] public class Chat : Hub { public void Send(string message) { // Access the id property set from the client. string id = Caller.id; // Set a property on the client state Caller.name = "SignalR"; } } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 13. Client Events in Server Side  To detect disconnects when using hubs, implement the IDisconnect interface.  To detect connects and reconnects, implement Iconnected. public class Status : Hub, IDisconnect, IConnected { public Task Disconnect() { return Clients.leave(Context.ConnectionId, DateTime.Now.ToString()); } public Task Connect() { return Clients.joined(Context.ConnectionId, DateTime.Now.ToString()); } public Task Reconnect(IEnumerable<string> groups) { return Clients.rejoined(Context.ConnectionId, DateTime.Now.ToString()); } } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 14. Broadcasting From Outside of a Hub  Sometimes you have some arbitrary code in an application that you want to be able to notify all clients connected when some event occurs. public class Notifier { public static void Say(string message) { var context = GlobalHost.ConnectionManager.GetHubContext<MyHub>(); context.Clients.say(message); } } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 15. Hub Routing  No need to specify a route for the hub as they are automatically accessible over a special url (/signalr) public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { RouteTable.Routes.MapHubs("~/signalr2"); } } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 16. Client Side © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 17. JavaScript Client <script src="Scripts/jquery.signalR-0.5.3.min.js" type="text/javascript"></script> <script src="/signalr/hubs" type="text/javascript"></script> <script type="text/javascript"> $(function () { // Proxy created on the fly var chat = $.connection.chat; // Declare a function on the chat hub so the server can invoke it chat.addMessage = function (message) { $('#messages').append('<li>' + message + '</li>'); }; $("#broadcast").click(function () { // Call the chat method on the server chat.send($('#msg').val()); }); // Start the connection $.connection.hub.start(); }); </script> © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 18. JavaScript API  $.connection.hub  The connection for all hubs (url points to /signalr). Returns a connection  $.connection.hub.id  The client id for the hub connection.  $.connection.hub.logging  Set to true to enable logging. Default is false  $.connection.hub.start()  Starts the connection for all hubs. © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 19. Exposing Methods For The Server  The JavaScript client can declare methods that the server can invoke. myHub.{method} = callback  Method - name of the client side method.  Callback - A function to execute when the server invokes the method.  NOTE: if you misspell you will NOT get any warning or notifications even when logging is enabled.  NOTE: Unlike the name change in myHub, the function names here at the same as you call in Server code. © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 20. Invoking methods on the server  The proxy will generate methods on each hub for the associated server methods.  Returns jQuery deferred.  NOTE: Method names will be camel cased similarly to hub names. myHub.someMethod() .done(function(result) {}) .fail(function(error) {}); © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 21. Round-Tripping State  To set state on the hub. Just assign values to properties on the hub object.  myHub.name = “E4D”  Whenever a call to the hub the state will be sent to the server. © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 22. Cross Domain Support  You can talk to SignalR servers either using websockets, cors enabled longpolling (not supported by all browsers) or jsonp longpolling.  Cross domain urls are auto detected. We'll use xhr by default if the client (your browser) supports it. $.connection.hub.url = 'http://localhost:8081/signalr'; $.connection.hub.start(); © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 23. Cross Domain Support (JSONP)  Cross domain fall back to jsonp longpolling.  To use jsonp longpolling, you can specify that option explicitly: $.connection.hub.url = 'http://localhost:8081/signalr'; $.connection.hub.start({ jsonp: true }); © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 24. $.connection.hub.logging = true; var myHub = $.connection.myHub; myHub.someState = "SomeValue"; function connectionReady() { alert("Done calling first hub serverside-function"); }; myHub.SomeClientFunction = function () { alert("serverside called 'Clients.SomeClientFunction()'"); }; $.connection.hub.error(function () { alert("An error occured"); }); $.connection.hub.start() .done(function () { myHub.SomeFunction(SomeParam) //e.g. a login or init .done(connectionReady); }) .fail(function () { alert("Could not Connect!"); }); © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 25. Client JavaScript © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 26. .Net Client // Connect to the service var hubConnection = new HubConnection("http://localhost/mysite"); // Create a proxy to the chat service var chat = hubConnection.CreateProxy("chat"); // Print the message when it comes in chat.On("addMessage", message => Console.WriteLine(message)); // Start the connection hubConnection.Start().Wait(); string line = null; while ((line = Console.ReadLine()) != null) { // Send a message to the server chat.Invoke("Send", line).Wait(); } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 27. SignalR Internals © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 28. Default Start Point  The AspNetBootstrapper class initializes the Asp.Net hosting pipeline with HubDispatcher [assembly: PreApplicationStartMethod(typeof(AspNetBootstrapper), "Initialize")] namespace SignalR.Hosting.AspNet { public static class AspNetBootstrapper { ... // Initializes the ASP.NET host and sets up the default hub route (~/signalr). public static void Initialize() { Add Route ... RouteTable.Routes.MapHubs(); ... } private static void OnAppDomainShutdown() { ... } } } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 29. MapHubs Extension Methods  The MapHubs does two things :  Register the AspNetAssemblyLocator  Build the route class for SignalR var locator = new Lazy<IAssemblyLocator>(() => new AspNetAssemblyLocator()); resolver.Register(typeof(IAssemblyLocator), () => locator.Value); var route = new Route(routeUrl, new HubDispatcherRouteHandler(url, resolver)); routeUrl = "~/signalr /{*operation}" © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 30. HubDispatcherRouteHandler public IHttpHandler GetHttpHandler(RequestContext requestContext) { var dispatcher = new HubDispatcher(_url); return new AspNetHandler(_resolver, dispatcher); } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 31. Persistent Connection © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 32. HubDispatcher public override Task ProcessRequestAsync(HostContext context) { // Generate the proxy if (context.Request.Url.LocalPath.EndsWith("/hubs",StringComparison.OrdinalIgnoreCase)) { context.Response.ContentType = "application/x-javascript"; return context.Response.EndAsync(_proxyGenerator.GenerateProxy(_url)); } ... return base.ProcessRequestAsync(context); } protected override Task OnReceivedAsync(IRequest req, string connId, string data) { ... // 1. Create the hub ... // 2. Resolve the method ... // 3. Resolving the state ... // 4. Invoke the method ... } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 33. SignalR Extensibility © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 34. Low Level Connection  You can add your own route RouteTable.Routes.MapConnection<MyConnection>("echo", "echo/{*operation}"); public class MyConnection : PersistentConnection { protected override Task OnReceivedAsync(string clientId, string data) { // Broadcast data to all clients return global::SignalR.Connection.Broadcast(data); } } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 35. SignalR Extensibility  SignalR is built with dependency injection in mind. © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 36. Configuring SignalR  ConnectionTimeout  The amount of time to leave a connection open before timing out. Default is 110 seconds.  DisconnectTimeout  The amount of time to wait after a connection goes away before raising the disconnect event. Default is 20 seconds.  HeartBeatInterval  The interval for checking the state of a connection. Default is 10 seconds.  KeepAlive  The amount of time to wait before sending a keep alive packet over an idle connection. Set to null to disable keep alive. This is set to 30 seconds by default. When this is on, the ConnectionTimeout will have no effect. © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 37. Replacing individual components  You can replace individual parts of SignalR without replacing the DependencyResolver by calling. GlobalHost .DependencyResolver .Register( typeof(IConnectionIdFactory), () => new CustomIdFactory() ); © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 38. Replaceable Components  The following lists the pluggable interfaces in SignalR. Interfaces Description IMessageBus Message bus. IConnectionIdGenerator Generates connection ids. IAssemblyLocator Locates assemblies to find hubs in. IJavaScriptProxyGenerator Generates the client proxy for hubs. IJavaScriptMinifier Allows the dynamic javascript proxy to be minified. IJsonSerializer Used to serialize and deserialze outgoing/incoming data. © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 39. Server Side © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
  • 40. Client Side © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il