Table of Contents

Class PlatformPipeName

Namespace
RDCore.SDK.Platform
Assembly
RDCore.SDK.Protocol.dll

Names the pipes that the processes of the platform talk through: a new name for each pipe, short enough to be a pipe on every supported system.

public static class PlatformPipeName
Inheritance
PlatformPipeName
Inherited Members

Remarks

On Windows a pipe is \.\pipe\<name>. On Linux and macOS, .NET makes it a Unix domain socket at GetTempPath()CoreFxPipe_<name>, and the system caps that path: 108 bytes on Linux, 104 on macOS. A Mac's temporary folder ($TMPDIR, /var/folders/<2>/<30>/T/) takes 49 of them, which leaves 44 for the name. A longer name cannot be opened as a pipe there, and the process that is to listen on it, or connect to it, fails to start.

A name is at most MaxLength characters. That leaves room for a temporary folder longer than a Mac's, and for a suffix that a component appends to name a second pipe of its own.

Fields

MaxLength

The longest name New(CoreServerComponent) makes, in characters: 24.

public const int MaxLength = 24

Field Value

int

Methods

New(CoreServerComponent)

A new pipe name for a component of the platform, one that no other instance has: rdc-<component>-<random>, at most MaxLength characters, in lowercase letters, digits and hyphens.

public static string New(CoreServerComponent component)

Parameters

component CoreServerComponent

The component that listens on the pipe, whichever process connects to it: LanguageServer for the language server.

Returns

string

The name, for the pipe's server and its client to open.

Exceptions

ArgumentOutOfRangeException

component is not a defined CoreServerComponent value.