5 #ifndef BITCOIN_UTIL_TOKENPIPE_H 6 #define BITCOIN_UTIL_TOKENPIPE_H 88 static std::optional<TokenPipe>
Make();
107 for (
int i = 0; i < 2; ++i) {
108 m_fds[i] = other.m_fds[i];
115 for (
int i = 0; i < 2; ++i) {
116 m_fds[i] = other.m_fds[i];
127 #endif // BITCOIN_UTIL_TOKENPIPE_H
void Close()
Explicit close function.
int TokenWrite(uint8_t token)
Write token to endpoint.
TokenPipe(TokenPipe &&other)
int TokenRead()
Read token from endpoint.
Status
Return value constants for TokenWrite and TokenRead.
void Close()
Close and end of the pipe that hasn't been moved out.
An interprocess or interthread pipe for sending tokens (one-byte values) over.
TokenPipeEnd TakeReadEnd()
Take the read end of this pipe.
TokenPipeEnd(TokenPipeEnd &&other)
static std::optional< TokenPipe > Make()
Create a new pipe.
TokenPipe & operator=(TokenPipe &&other)
bool IsOpen()
Return whether endpoint is open.
TokenPipeEnd TakeWriteEnd()
Take the write end of this pipe.
Unexpected end of stream.
TokenPipeEnd & operator=(TokenPipeEnd &&other)