6#include <bitcoin-build-config.h>
41 ssize_t result = write(
m_fd, &token, 1);
48 }
else if (result == 0) {
60 ssize_t result = read(
m_fd, &token, 1);
67 }
else if (result == 0) {
84 int fds[2] = {-1, -1};
85#if HAVE_O_CLOEXEC && HAVE_DECL_PIPE2
86 if (pipe2(fds, O_CLOEXEC) != 0) {
@ TS_EOS
Unexpected end of stream.
int TokenWrite(uint8_t token)
Write token to endpoint.
void Close()
Explicit close function.
int TokenRead()
Read token from endpoint.
void Close()
Close and end of the pipe that hasn't been moved out.
TokenPipeEnd TakeReadEnd()
Take the read end of this pipe.
TokenPipeEnd TakeWriteEnd()
Take the write end of this pipe.
static std::optional< TokenPipe > Make()
Create a new pipe.