Book Image

SignalR: Real-time Application Development - Second Edition

By : Einar Ingerbrigsten
Book Image

SignalR: Real-time Application Development - Second Edition

By: Einar Ingerbrigsten

Overview of this book

Table of Contents (19 chapters)
SignalR – Real-time Application Development Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
11
Hosting a Server Using Self-hosted OWIN
Index

Getting started with the server-side


We will need some C# code to initialize the server side of things.

SignalR is configured through something called Open Web Interface for .NET (OWIN). There are other, more traditional ways of doing this, but this is the preferred way and also conceptually how things are evolving in the ASP.NET space. We will be using it throughout the book in different forms.

Tip

Its goal is to define a standard interface between .NET web servers and web applications. Read more at http://owin.org.

  1. Let's add a class called Startup to the project. Right-click on the project and select Add | Class. Give the file a name Startup.cs.

  2. Replace all the using statements with the following:

    using Microsoft.Owin;
    using Owin;
  3. Inside the Startup class, we will a Configuration method. Make the class look as follows:

    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
        }
    }
  4. As you can see, the class is not inheriting anything or implementing an interface. The signature...