How WinForm and uwp communicate in two directions

守給你的承諾、 提交于 2020-01-04 03:49:16

问题


WinForm and uwp how to communicate two-way, I used MQTT, the shortcoming is that when the amount of data sent is relatively large, there will be a very serious delay, but also try socket mode, but WinForm can not connect to uwp, which friend please help me, thank you!


回答1:


From the document Note part, two independent uwp run on the same computer can not communicate by socket.

As a consequence of network isolation, Windows disallows establishing a socket connection (Sockets or WinSock) between two UWP apps running on the same machine; whether that's via the local loopback address (127.0.0.0), or by explicitly specifying the local IP address. More about UWP apps can communicate with one another, see App-to-app communication.

Besides, you can also integrate app services into your UWP app to allow the sharing of data and functionality across apps, see the topic Use app services and extensions.

Lastly, you can also refer this similar thread:

Communication between UWP and Non UWP app




回答2:


UWP and WinForms should be able to communicate behind the scenes with standard C# constructs. I never used UWP, but in with WPF, WPF and WinForms more or less sit in the same process space. No need for fancy interprocess communication.

That said, perhaps you could give us an idea of what data is being passed?

EDIT: After some more info, I now understand you are talking about two different apps. In the past, WCF was the go-to mechanism for this, but I think there are better options these days. I yield the answer to someone more knowledgable



来源:https://stackoverflow.com/questions/50638912/how-winform-and-uwp-communicate-in-two-directions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!