5#ifndef WPINET_UV_PIPE_H_
6#define WPINET_UV_PIPE_H_
28 struct private_init {};
31 explicit Pipe(
const private_init&) {}
32 ~Pipe() noexcept override = default;
65 void Reuse(std::function<
void()> callback,
bool ipc =
false);
100 bool Accept(
const std::shared_ptr<Pipe>& client) {
139 const std::shared_ptr<PipeConnectReq>& req);
187 Pipe* DoAccept()
override;
190 std::function<void()> callback;
193 std::unique_ptr<ReuseData> m_reuseData;
then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file
Definition: ThirdPartyNotices.txt:192
Connection request.
Definition: NetworkStream.h:25
NetworkStream & GetStream() const
Definition: NetworkStream.h:29
bool Invoke(F &&f, Args &&... args) const
Definition: Handle.h:267
Event loop.
Definition: Loop.h:37
std::shared_ptr< NetworkStream > Accept()
Accept incoming connection.
Definition: NetworkStream.h:92
Definition: NetworkStream.h:128
uv_pipe_t * GetRaw() const noexcept
Get the underlying handle data structure.
Definition: NetworkStream.h:143
Pipe connection request.
Definition: Pipe.h:199
Pipe & GetStream() const
Definition: Pipe.h:201
Pipe handle.
Definition: Pipe.h:27
void Open(uv_file file)
Open an existing file descriptor or HANDLE as a pipe.
Definition: Pipe.h:112
std::string GetSock()
Get the name of the Unix domain socket or the named pipe.
static std::shared_ptr< Pipe > Create(Loop &loop, bool ipc=false)
Create a pipe handle.
std::string GetPeer()
Get the name of the Unix domain socket or the named pipe to which the handle is connected.
Pipe(const private_init &)
Definition: Pipe.h:31
void Connect(std::string_view name, const std::shared_ptr< PipeConnectReq > &req)
Connect to the Unix domain socket or the named pipe.
~Pipe() noexcept override=default
void SetPendingInstances(int count)
Set the number of pending pipe instance handles when the pipe server is waiting for connections.
Definition: Pipe.h:174
void Bind(std::string_view name)
Bind the pipe to a file path (Unix) or a name (Windows).
std::shared_ptr< Pipe > Accept()
Accept incoming connection.
void Reuse(std::function< void()> callback, bool ipc=false)
Reuse this handle.
void Chmod(int flags)
Alters pipe permissions, allowing it to be accessed from processes run by different users.
Definition: Pipe.h:184
void Connect(std::string_view name, std::function< void()> callback)
Connect to the Unix domain socket or the named pipe.
bool Accept(const std::shared_ptr< Pipe > &client)
Accept incoming connection.
Definition: Pipe.h:100
basic_string_view< char > string_view
Definition: core.h:501
constexpr auto count() -> size_t
Definition: core.h:1203
Definition: WebSocket.h:27
flags
Definition: http_parser.h:206
int uv_file
Definition: unix.h:117
UV_EXTERN void uv_pipe_pending_instances(uv_pipe_t *handle, int count)
UV_EXTERN int uv_pipe_open(uv_pipe_t *, uv_file file)
UV_EXTERN int uv_pipe_chmod(uv_pipe_t *handle, int flags)