Bitcoin Core 32.1.0
P2P Digital Currency
Loading...
Searching...
No Matches
SocketTestingSetup Class Reference

#include <setup_common.h>

Inheritance diagram for SocketTestingSetup:
[legend]
Collaboration diagram for SocketTestingSetup:
[legend]

Public Member Functions

 SocketTestingSetup ()
 ~SocketTestingSetup ()
template<typename T = DynSock>
std::shared_ptr< typename T::Pipes > ConnectClient (std::span< const std::byte > data)
 Connect to the socket with a mock client and send pre-loaded data.
Public Member Functions inherited from BasicTestingSetup
void SeedRandomForTest (SeedRand seed)
 Seed the global RNG state and m_rng for testing and log the seed value.
 BasicTestingSetup (ChainType chainType=ChainType::MAIN, TestOpts={})
 ~BasicTestingSetup ()

Private Attributes

decltype(CreateSock) m_create_sock_orig
 Save the original value of CreateSock here and restore it when the test ends.
DynSock::Queue m_accepted_sockets
 Queue of connected sockets returned by listening socket (represents network interface).

Additional Inherited Members

Public Attributes inherited from BasicTestingSetup
util::SignalInterrupt m_interrupt
node::NodeContext m_node
FastRandomContext m_rng
fs::path m_path_root
fs::path m_path_lock
bool m_has_custom_datadir {false}
ArgsManager m_args
 Test-specific arguments and settings.

Detailed Description

Definition at line 253 of file setup_common.h.

Constructor & Destructor Documentation

◆ SocketTestingSetup()

SocketTestingSetup::SocketTestingSetup ( )
explicit

Definition at line 643 of file setup_common.cpp.

Here is the call graph for this function:

◆ ~SocketTestingSetup()

SocketTestingSetup::~SocketTestingSetup ( )

Definition at line 661 of file setup_common.cpp.

Member Function Documentation

◆ ConnectClient()

template<typename T = DynSock>
std::shared_ptr< typename T::Pipes > SocketTestingSetup::ConnectClient ( std::span< const std::byte > data)
inline

Connect to the socket with a mock client and send pre-loaded data.

Returns the I/O pipes from the mock client so we can read response data sent to it. Template parameter selects the socket type: DynSock by default.

Definition at line 265 of file setup_common.h.

Here is the call graph for this function:

Member Data Documentation

◆ m_accepted_sockets

DynSock::Queue SocketTestingSetup::m_accepted_sockets
private

Queue of connected sockets returned by listening socket (represents network interface).

Definition at line 278 of file setup_common.h.

◆ m_create_sock_orig

decltype(CreateSock) SocketTestingSetup::m_create_sock_orig
private

Save the original value of CreateSock here and restore it when the test ends.

Definition at line 275 of file setup_common.h.


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