Is it correct to use SignalR for desktop applications?

Seçkin Durgay picture Seçkin Durgay · Jul 7, 2015 · Viewed 21.5k times · Source

Is SignalR suitable for windows desktop applications (winforms/wpf)?

What are the advantages and disadvantages using SignalR with windows desktop applications?

Are there any performance considerations?

I want to make real-time connections between server and a lot of clients. The connections will be constant.

Answer

Patrick Hofman picture Patrick Hofman · Jul 7, 2015

Is SignalR suitable for windows desktop applications (winforms/wpf)?

The answer from signalr.net is:

SignalR can be used to add any sort of "real-time" web functionality to your ASP.NET application.

(As stated correctly by others it can be self-hosted, so no need for IIS)

So the answer seems to be no. It is a server side API. But today is your lucky day, since the download of SignalR doesn't only reveal the server side API, but also a client side API called Microsoft.AspNet.SignalR.Client45 to use in your application. It works for WPF, WF or even console applications.

And even if it didn't, SignalR is just a wrapper around the WebSockets protocol, which is part of the HTTP protocol, which can be used on virtually any platform. The download also contains a sample for iOS and Xamarin for example.

What are the advantages and disadvantages using SignalR with windows desktop applications?

To have real-time notifications from and to the server.

Is there any performance problems?

That is a hard question to answer, since there is no reference point. Compared to what the performance is good or bad? Generally spoken, I don't think you have to worry to much about that. The API itself is fast, and it may prevent slow pull-requests you need to do else.