CHAPTER 43 WebHooks and SignalR

What’s In This Chapter?

  • Overview of SignalR
  • Creating a SignalR hub
  • Creating a SignalR client with HTML and JavaScript
  • Creating a SignalR .NET client
  • Using groups with SignalR
  • Overview of WebHooks
  • Creating WebHook receivers for GitHub and Dropbox

Wrox.com Code Downloads for This Chapter

The wrox.com code downloads for this chapter are found at www.wrox.com/go/professionalcsharp6 on the Download Code tab. The code for this chapter is divided into the following major examples:

  • Chat Server using SignalR
  • WPF Chat Client using SignalR
  • SaaS WebHooks Receiver Sample

Overview

With .NET you can use events to get notifications. You can register an event handler method with an event, also known as subscribing to events, and as soon as the event is fired from another place, your method gets invoked. Events cannot be used with web applications.

Previous chapters have covered a lot about web applications and web services. What was common with these applications and services is that the request was always started from the client application. The client makes an HTTP request and receives a response.

What if the server has some news to tell? There’s nothing like events that you can subscribe to, or are there? With the web technologies you’ve seen so far, this can be resolved by the client polling for new information. The client has to make a request to the server to ask whether new information is available. Depending on the request interval defined, this ...

Get Professional C# 6 and .NET Core 1.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.