WinterMute
WinterMute

Reputation: 131

UWP app and WPF app communication through local network

What is the best approach to communicate between UWP app (client app) installed on phone and WPF app itself installed on local machine if they are connected to the same router? Files should sync from client to server and vice versa.

As I investigated before there are WCF, Sockets, and Web. So what is the best one to use to create such functionality?

Upvotes: 3

Views: 923

Answers (2)

lindexi
lindexi

Reputation: 4327

For UWP that have not allowed calling localhost and you can use it to communicate to local wpf app.

More details here and here.

But you can make the uwp communicate to local wpf app in debug, see Deploying and debugging Universal Windows Platform (UWP) apps - UWP app developer | Microsoft Docs

If you want your uwp app can use localhost in release that you should use checknetisolation and you can see some way to use wcf in the article.

Upvotes: 2

Divisadero
Divisadero

Reputation: 913

It does not matter if the app is WPF or UWP. To choose framework like WCF or Sockets you need to know how complex your scenario is. If it is rather simple, I would advice agains WCF. It can be unnecessary complicated for basic usage. You can try web api - lite system using JSON. Generally speaking, I do recommend the framework enabling http protocol as it is reusable for almost every scenario. But that is not filter that would help you much :D

Upvotes: 3

Related Questions