Bitcoin Core 32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DynSock::Pipe Class Reference

Unidirectional bytes queue (FIFO). More...

#include <net.h>

Collaboration diagram for DynSock::Pipe:
[legend]

Public Member Functions

ssize_t GetBytes (void *buf, size_t len, int flags=0) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Get bytes and remove them from the pipe.
 
void PushBytes (const void *buf, size_t len) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Push bytes to the pipe.
 
void Eof () EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Signal end-of-file on the receiving end (GetBytes()).
 

Private Member Functions

std::vector< uint8_t > m_data GUARDED_BY (m_mutex)
 
bool m_eof GUARDED_BY (m_mutex)
 

Private Attributes

Mutex m_mutex
 

Detailed Description

Unidirectional bytes queue (FIFO).

Definition at line 244 of file net.h.

Member Function Documentation

◆ Eof()

void DynSock::Pipe::Eof ( )

Signal end-of-file on the receiving end (GetBytes()).

Definition at line 293 of file net.cpp.

Here is the call graph for this function:

◆ GetBytes()

ssize_t DynSock::Pipe::GetBytes ( void *  buf,
size_t  len,
int  flags = 0 
)

Get bytes and remove them from the pipe.

Parameters
[in]bufDestination to write bytes to.
[in]lenWrite up to this number of bytes.
[in]flagsSame 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 264 of file net.cpp.

Here is the call graph for this function:

◆ 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

Definition at line 270 of file net.h.

◆ PushBytes()

void DynSock::Pipe::PushBytes ( const void *  buf,
size_t  len 
)

Push bytes to the pipe.

Definition at line 286 of file net.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ m_mutex

Mutex DynSock::Pipe::m_mutex
private

Definition at line 268 of file net.h.


The documentation for this class was generated from the following files: