Reputation: 21
What I'm Trying To Do
Develop a C# WPF Windows application that can send and receive data to other WPF applications using a central web server running CentOS 6 Linux with MySQL.
The WPF client must be able to send a message to the server, and must be able to listen to the server in real-time for messages and display them as soon as they're posted.
The server-side program should be capable of parsing some of these messages into .NET data objects, and should be capable of broadcasting messages to all clients or just a specific one.
Also, if the server program could handle requests from a mobile app (Android app to server - server to WPF client & vice-versa) as well as WPF clients, that would be highly preferable, but not necessary.
Example
Server (server in Texas)
Admin Client (user in California)
Client 2 (user in Florida)
Client 3 (user in New York)
I send a "hello" broadcast from my computer, Admin Client, to Server.
Server receives message and broadcasts "hello" to all listening clients.
Client 2 and Client 3 show "hello" on their clients and respond "hey!"
Server receives "hey!" messages and sends both to Admin Client.
I send a message "open sesame" that executes RunOnMagicWord() method only on Client 2's application, and does nothing to Client 3.
Client2 runs RunOnMagicWord() and sends "done!" message to server after method executes.
Server receives "done!" message and sends to Admin Client.
What I've Looked Into
I'd prefer to keep everything in C# .NET including the server-side program, so that data sent between clients and to the server can be serialized easily. SignalR seems to be closest to what I'm looking for, but it seems to me it only works with IIS and not Apache/Linux. I don't have the option of switching to IIS, and it also feels like I may be over-complicating the whole thing, so...
My Question
Am I headed down the right path looking at using something like SignalR? If so, how do I get it to run on my CentOS server? Or is there a simpler way altogether of a Linux/MySQL server providing this kind of functionality to .NET applications?
Edit: Added other things I tried, reformatted paragraphs, added additional restrictions I have with this project in response to a comment
Upvotes: 2
Views: 1905
Reputation: 9024
Everything you mentioned could work. But decision of what you should use can be driven by business requirements and constraints:
For this kind of chat functionality, SignalR and mono .net app on linux should work fine. Also, Signalr is not the only option here, you have many websockets implementations for .net, like https://github.com/StackExchange/NetGain
Upvotes: 5