Unidirectional bytes or CNetMessage queue (FIFO).
More...
#include <net.h>
Unidirectional bytes or CNetMessage queue (FIFO).
Definition at line 218 of file net.h.
◆ Eof()
void DynSock::Pipe::Eof |
( |
| ) |
|
◆ GetBytes()
ssize_t DynSock::Pipe::GetBytes |
( |
void * |
buf, |
|
|
size_t |
len, |
|
|
int |
flags = 0 |
|
) |
| |
Get bytes and remove them from the pipe.
- Parameters
-
[in] | buf | Destination to write bytes to. |
[in] | len | Write up to this number of bytes. |
[in] | flags | Same as the flags of recv(2) . Just MSG_PEEK is honored. |
- Returns
- The number of bytes written to
buf
. 0
if Eof()
has been called. If no bytes are available then -1
is returned and errno
is set to EAGAIN
.
Definition at line 247 of file net.cpp.
◆ GetNetMsg()
std::optional< CNetMessage > DynSock::Pipe::GetNetMsg |
( |
| ) |
|
Deserialize a CNetMessage
and remove it from the pipe.
If not enough bytes are available then the function will wait. If parsing fails or EOF is signaled to the pipe, then std::nullopt
is returned.
Definition at line 269 of file net.cpp.
◆ GUARDED_BY() [1/2]
std::vector< uint8_t > m_data DynSock::Pipe::GUARDED_BY |
( |
m_mutex |
| ) |
|
|
private |
◆ GUARDED_BY() [2/2]
bool m_eof DynSock::Pipe::GUARDED_BY |
( |
m_mutex |
| ) |
|
|
inlineprivate |
◆ PushBytes()
void DynSock::Pipe::PushBytes |
( |
const void * |
buf, |
|
|
size_t |
len |
|
) |
| |
Push bytes to the pipe.
Definition at line 307 of file net.cpp.
◆ PushNetMsg()
template<typename... Args>
void DynSock::Pipe::PushNetMsg |
( |
const std::string & |
type, |
|
|
Args &&... |
payload |
|
) |
| |
◆ WaitForDataOrEof()
Return when there is some data to read or EOF has been signaled.
- Parameters
-
Definition at line 322 of file net.cpp.
◆ m_cond
std::condition_variable DynSock::Pipe::m_cond |
|
private |
◆ m_mutex
Mutex DynSock::Pipe::m_mutex |
|
private |
The documentation for this class was generated from the following files: