LLVM 24.0.0git
llvm::orc::ConnectionSpec Class Reference

The parsed form of a string describing one connection a process should establish with its peer: More...

#include "llvm/ExecutionEngine/Orc/Shared/ConnectionSpec.h"

Public Member Functions

StringRef getTransport () const
 The transport name, e.g. "tcp". Never empty.
StringRef getAction () const
 The action name, e.g.
StringRef getDescriptor () const
 The transport-specific address. May be empty (e.g. "fd=").

Static Public Member Functions

static LLVM_ABI Expected< ConnectionSpecparse (StringRef Spec)
 Parses Spec as <transport>[:<action>]=<descriptor>.

Detailed Description

The parsed form of a string describing one connection a process should establish with its peer:

<transport>[:<action>]=<descriptor>

E.g. "fd=3", "tcp:connect=localhost:20000", "tcp:listen=[::1]:0". Such strings typically reach a process as a command-line argument, but nothing in the grammar or the parser assumes that.

A spec describes what the process reading it does, so the two ends of one connection carry different specs: an executor told "tcp:listen=:0" pairs with a controller told "tcp:connect=<host>:<port>".

The parser only checks punctuation: the transport and action names are opaque tokens, and the descriptor's syntax is entirely up to the transport. Splitting the action from the transport is confined to the text before the first '=', which lets a descriptor contain ':' and '=' unescaped (e.g. "tcp:listen=[::1]:0", "unix:listen=/tmp/a=b.sock").

All three fields are preserved verbatim, so callers matching a transport or action name against a known set do so case-sensitively.

Definition at line 45 of file ConnectionSpec.h.

Member Function Documentation

◆ getAction()

StringRef llvm::orc::ConnectionSpec::getAction ( ) const
inline

The action name, e.g.

"listen" or "connect". May be empty: direction is degenerate for some transports (an inherited socket fd is already connected), so single-mode transports omit it.

Definition at line 56 of file ConnectionSpec.h.

◆ getDescriptor()

StringRef llvm::orc::ConnectionSpec::getDescriptor ( ) const
inline

The transport-specific address. May be empty (e.g. "fd=").

Definition at line 59 of file ConnectionSpec.h.

◆ getTransport()

StringRef llvm::orc::ConnectionSpec::getTransport ( ) const
inline

The transport name, e.g. "tcp". Never empty.

Definition at line 51 of file ConnectionSpec.h.

◆ parse()

Expected< ConnectionSpec > ConnectionSpec::parse ( StringRef Spec)
static

Parses Spec as <transport>[:<action>]=<descriptor>.

Definition at line 20 of file ConnectionSpec.cpp.

References makeConnectionSpecError().


The documentation for this class was generated from the following files: