How to setup asp.net project to receive data from another server

MattNorman

Well-known member
Joined
May 22, 2021
Messages
75
Programming Experience
1-3
I am currently in the process of learning asp.net mvc with the goal of converting a WPF app to a web app.

The WPF app consists of a client application and a server application. The server application performs a few different functions, however the main function is to retrieve data via UI automation. It retrieves the data every 3 seconds, holds it in memory and then publishes it out to any clients that are subscribed.

I use the NetworkComms.Net library for the client registration and publishing.

Can anyone point me in the right direction around how something like this can be achieved in asp.net?

The WPF server app would remain in place as it is required due to the way the data has to be colleting by automating another Windows app.

Can I simply replicate what the WPF client app is currently doing using the NetworkComms library? Would the logic for receiving the data sit within the relevant controller?

Appreciate any advice or pointer on what to look for.

Matt
 

MattNorman

Well-known member
Joined
May 22, 2021
Messages
75
Programming Experience
1-3
It seems that SignalR may be the way to go with broadcasting the data changes to clients.

In terms of getting the data that the Windows server app is getting, would this just be a case of running a background thread that checks for any new files and then loads the data and broadcasts it?
 

MattNorman

Well-known member
Joined
May 22, 2021
Messages
75
Programming Experience
1-3
I've done some testing and it looks like I can use the NetworkComms library to get the data from the windows server app.

I did this by creating a static class that has a method to register for data updates and then calling that method from global.asax.

I was a little concerned that it might run this for every new web client however it doesn't appear to be the case looking at my debug info. I set it to generate a new Guid when the static method is run and then log that in the output every time data is received. I only saw the one Guid so seems to only run once.

From there I should be able to utilise something like SignalR to publish the data to web clients.
 
Top Bottom