简体   繁体   中英

Named Pipe in UWP App

I'm using a named pipe server in my UWP app, but I cannot get a python client running from the console to connect. Where is the location of this pipe? And I think it has to do with UWP sandbox restrictions. Looked around a lot but seems microsoft is just getting to this stuff.

# CS
new NamedPipeServerStream("LOCAL\MYPIPE");

# Python
f = open(r"\.\pipeLOCAL\MYPIPE", 'r+b', 0)

So while some MSFT resources may claim that UWP supports memory mapped files, it does not.

That is unless you are willing to use the desktop bridge, but given the complexities there, including the requirement you use 32bit!, you might as well bridge over TCP.

This may change with NET Core 3 in Q1? 2019.

I hope if an MSFT employee reads this they can ask the right people why we can't have memory mapped files on side-loaded internal enterprise only apps. No doubt a major impediment to UWP uptake.

I used AppServiceConnection

Covered by these tutorials (sorry for the link only answer but these tutorials are too long to paste here):

Create and consume an app service

Convert an app service to run in the same process as its host app

In my C# console application I also needed to reference these two libraries from here to make it work

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll

C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM