Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

NamedPipeClientStream not implemented in Unity 2019.4.22f1 (LTS) IL2CPP

Discussion in 'Scripting' started by plmx, Mar 20, 2021.

  1. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    308
    Hi. I'm getting the following error when trying to instantiate a NamedPipeClientStream on Unity 2019.4.22f1 on an Android device using IL2CPP. This error does not occur when using the Mono backend.

    Code (CSharp):
    1. 03-20 16:03:36.924  5207  5279 E Unity   : NotImplementedException: The method or operation is not implemented.
    2. 03-20 16:03:36.924  5207  5279 E Unity   :   at System.IO.Pipes.NamedPipeClientStream..ctor (System.String serverName, System.String pipeName, System.IO.Pipes.PipeAccessRights desiredAccessRights, System.IO.Pipes.PipeOptions options, System.Security.Principal.TokenImpersonationLevel impersonationLevel, System.IO.HandleInheritability inheritability) [0x00000] in <00000000000000000000000000000000>:0
    3. 03-20 16:03:36.924  5207  5279 E Unity   :   at System.IO.Pipes.NamedPipeClientStream..ctor (System.String serverName, System.String pipeName, System.IO.Pipes.PipeDirection direction, System.IO.Pipes.PipeOptions options) [0x00000] in <00000000000000000000000000000000>:0
    I found a (fixed) bug report for this here (https://issuetracker.unity3d.com/is...on-is-thrown-when-use-system-dot-io-dot-pipes), so, this feels like a regression?

    Thanks.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,773
    Thanks for reporting this issue. The bug fix you mentioned occurred only on Windows platforms. At the moment, named pipes are not supported for IL2CPP on non-Windows platforms (which includes Android of course).

    I'm curious, what is the use case you have for named pipes on Android?
     
  3. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    308
    We use FFMPEG for audio conversion and read the result from a named pipe to avoid having to go through an actual file.

    As a workaround for the class not being available, I'm now simply using Java to read from the pipe and pass the (buffered) results a megabyte at a time to C#, which works and is as performant as the NamedPipeClientStream on Mono.
     
    Last edited: Nov 20, 2022
    JoshPeterson likes this.
  4. Garni1002

    Garni1002

    Joined:
    Jun 1, 2023
    Posts:
    1
    Hi. Is there any update regarding the support of IL2CPP?
    Im trying to use a NamedPipeClientStream with WebGL and only found this fixed issue (https://issuetracker.unity3d.com/is...em-dot-io-dot-pipes-dot-namedpipeclientstream). I'm currently using version 2021.3.27f1 (LTS).

    The development console throws:

    PlatformNotSupportedException: Operation is not supported on this platform.
    at System.IO.Pipes.PipeStream.GetPipePath (System.String serverName, System.String pipeName)


    Thank you in advance.

    Edit:
    As far as I see there is no problem with IL2CPP (building a native Windows application based on IL2CPP works) but with WebGL as it seems to not support working with named pipes.
    Nonetheless I would be happy to get approval on my theorie or deviating information.
    Thanks.
     
    Last edited: Jul 6, 2023
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,773
    We don't expect to support named pipe on WebGL at any point in the future. The underlying platform does not have the support we need for them, as far as I know.
     
    Garni1002 likes this.