6#include <config/bitcoin-config.h>
34 ssize_t result = write(
m_fd, &token, 1);
41 }
else if (result == 0) {
52 ssize_t result = read(
m_fd, &token, 1);
59 }
else if (result == 0) {
76 int fds[2] = {-1, -1};
77#if HAVE_O_CLOEXEC && HAVE_DECL_PIPE2
78 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.