6#include <config/bitcoin-config.h>
41 }
else if (result == 0) {
59 }
else if (result == 0) {
76 int fds[2] = {-1, -1};
77#if HAVE_O_CLOEXEC && HAVE_DECL_PIPE2
@ 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.
An interprocess or interthread pipe for sending tokens (one-byte values) over.
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.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...