 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
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
int TokenRead()
Read token from endpoint.
An interprocess or interthread pipe for sending tokens (one-byte values) over.
void Close()
Explicit close function.
TokenPipeEnd(TokenPipeEnd &&other)
int TokenWrite(uint8_t token)
Write token to endpoint.
TokenPipe(TokenPipe &&other)
static std::optional< TokenPipe > Make()
Create a new pipe.
TokenPipe & operator=(TokenPipe &&other)
TokenPipeEnd TakeWriteEnd()
Take the write end of this pipe.
@ TS_EOS
Unexpected end of stream.
bool IsOpen()
Return whether endpoint is open.
TokenPipeEnd TakeReadEnd()
Take the read end of this pipe.
void Close()
Close and end of the pipe that hasn't been moved out.
TokenPipeEnd & operator=(TokenPipeEnd &&other)
Status
Return value constants for TokenWrite and TokenRead.