14#ifndef LLVM_SUPPORT_RAW_SOCKET_STREAM_H
15#define LLVM_SUPPORT_RAW_SOCKET_STREAM_H
25class raw_socket_stream;
62 std::string SocketPath;
102 const std::chrono::milliseconds &Timeout = std::chrono::milliseconds(-1));
121 uint64_t current_pos()
const override {
return 0; }
149 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 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
void shutdown()
Closes the FD, unlinks the socket file, and writes to PipeFD.
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.
static Expected< std::unique_ptr< raw_socket_stream > > createConnectedUnix(StringRef SocketPath)
Create a raw_socket_stream connected to the UNIX domain socket at SocketPath.
ssize_t read(char *Ptr, size_t Size, const std::chrono::milliseconds &Timeout=std::chrono::milliseconds(-1))
Attempt to read from the raw_socket_stream's file descriptor.
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,...