Reputation: 496
I need to develop a NET Framework MVC web app that takes 5 items in a form, each one consisting in a description and an image. I need to post these to a server app (locally) that takes this data and stores it in an XML file for example (No need to use relational DB). My server app is a console based in NET Framework. When I change the description of the file in the server, I have to display in "real time" the updated values in the ASP NET web app in the client side, so somehow I need to send back the values of the file back to the ASP NET web app. I have been looking to signalR but seems to be more suitable for instant messaging rather than working with files, so I thought websockets would be a good idea. Doesn't seem too complicated but I have never worked with websockets so I wonder if this is possible to do with my suggestion above so I have a few questions:
I much appreciate some help here.
Upvotes: 0
Views: 355
Reputation: 1313
I would choose building an API since you can send the updates whenever they change, no need to wait or keep connections open.
If you really have to send updates in realtime, SignalR combines different ways of keeping a connection open, so it could be the best option.
I prefer using SimpleTcp to easily establish a tcp communication between server (web app) and client (desktop or console) so this is also something you can consider.
Upvotes: 2
Reputation: 31
SignalR already has websocket implementation. Your solution could be for example creating the signalR hub inside the console application and then using the webapp to connect to it. On either end you call a method that changes the other side.
Upvotes: 1