SignalR Chat Server and Chat Client Application

Today , I will tell you how to create chat client and chat server.

Create a Chat Server

Start an mvc project in the first step.

We build the following packages in the project(Tools ->NuGet Package Manager -> Package Manager Console)

Later, we create a  OWIN Startup class

  • File:Startup.cs

Create a SignaR Hub Class

  • I’ve written explanations of the necessary places in the code, it’s easy to understand. Leave a message in the place you do not know.

The purpose of using Query String and header is also to be understood in Android and iOS applications.

Create a Chat Client

You setup command line.Do not install if you do not want to use Metroframework.

Create a new C# form application.(I will do this in the android later).

You can create projects in the same solution as below

Then we design the form screen. I designed it this way. Design it as you like.

In the code I put the necessary description lines clearly.If you do not want to use MetroFramework, change Form1: MetroForm to Form1: Form

  • File:Form1.cs

Code part complete.

Run Code

Download Source Code

You may also like...

5 Responses

  1. Belal says:

    Great post friend!!
    You saved my time ..

    Thank you

  2. Pierino Bianchi says:

    Thank You !
    Your post was helpful to me.

    You happen to have the javascript version of the C # client

  3. jack says:

    hi all
    the firsts thanks you very much
    now i want to connect signalr to server host, but when i change link “http://…” so signalr not connect
    thank u

Leave a Reply

Your email address will not be published.