14#ifndef LLVM_SUPPORT_RAW_SOCKET_STREAM_H
15#define LLVM_SUPPORT_RAW_SOCKET_STREAM_H
26class raw_socket_stream;
63 std::string SocketPath;
103 const std::chrono::milliseconds &
Timeout = std::chrono::milliseconds(-1));
122 uint64_t current_pos()
const override {
return 0; }
134 createConnectedUnix(
StringRef SocketPath);
150 const std::chrono::milliseconds &
Timeout = std::chrono::milliseconds(-1));
Tagged union holding either a T or a Error.
Manages a passive (i.e., listening) UNIX domain socket.
static LLVM_ABI Expected< ListeningSocket > createUnix(StringRef SocketPath, int MaxBacklog=llvm::hardware_concurrency().compute_thread_count())
Creates a listening socket bound to the specified file system path.
ListeningSocket(const ListeningSocket &LS)=delete
ListeningSocket & operator=(const ListeningSocket &)=delete
LLVM_ABI void shutdown()
Closes the FD, unlinks the socket file, and writes to PipeFD.
LLVM_ABI ~ListeningSocket()
LLVM_ABI Expected< std::unique_ptr< raw_socket_stream > > accept(const std::chrono::milliseconds &Timeout=std::chrono::milliseconds(-1))
Accepts an incoming connection on the listening socket.
StringRef - Represent a constant reference to a string, i.e.
A raw_ostream of a file for reading/writing/seeking.
This is an optimization pass for GlobalISel generic memory operations.
ThreadPoolStrategy hardware_concurrency(unsigned ThreadCount=0)
Returns a default thread strategy where all available hardware resources are to be used,...
@ Timeout
Reached timeout while waiting for the owner to release the lock.