C
C#3mo ago
shahul

Best Way to set up a two directional communication in a windows form application

I am building a desktop application to capture fingerprints, but I needed to enable a two-way communication b/w the application and web UI because all other data is collected by the web app. I need to start the capturing process after getting a request from web UI and need to send captured data to web. So what is the best way to do this, is that possible to start a web socket server in windows form application when the application is opened ?
Also, one more question what about windows console app with web socket server, so I only need to show UI after a new request received Actually I am a JS dev this specific requirement lead me here Thanks in advance
5 Replies
WEIRD FLEX
WEIRD FLEX3mo ago
you can create a ClientWebSocket (System.Net.WebSockets) if you need more than just a request, but it's the webapp that needs to initiate it also if this is a secure application (like a fingerprint scan would be) don't you have a "stronger" architecture? if there are appliances in the middle you probably have to configure them to not close the websocket
Lex Li
Lex Li3mo ago
Or simply host a SignalR hub in your desktop app, so that the web UI can connect it to communicate (over WebSockets or another underlying channel).
WEIRD FLEX
WEIRD FLEX3mo ago
i never tried this, but does signalr work outside asp net? or do you have to import the libraries?
Lex Li
Lex Li3mo ago
Starting ASP.NET 4.x Web API you can host ASP.NET pipeline anywhere, even inside a desktop app. So, now you can do the same for SignalR hub. Depending on what you are using, .NET Framework or just .NET, you need to use certain NuGet packages to acquire the bits.
shahul
shahul3mo ago
Thanks guys I will try above methods Thanks for your time
Want results from more Discord servers?
Add your server
More Posts