Bitcoin Core 31.99.0
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
SocketTestingSetup Class Reference

#include <setup_common.h>

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

Public Member Functions

 SocketTestingSetup ()
 
 ~SocketTestingSetup ()
 
std::shared_ptr< DynSock::PipesConnectClient (std::span< const std::byte > data)
 Connect to the socket with a mock client (a DynSock) and send pre-loaded data. More...
 
- 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. More...
 
 BasicTestingSetup (ChainType chainType=ChainType::MAIN, TestOpts={})
 
 ~BasicTestingSetup ()
 

Private Attributes

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

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. More...
 

Detailed Description

Definition at line 253 of file setup_common.h.

Constructor & Destructor Documentation

◆ SocketTestingSetup()

SocketTestingSetup::SocketTestingSetup ( )
explicit

Definition at line 641 of file setup_common.cpp.

◆ ~SocketTestingSetup()

SocketTestingSetup::~SocketTestingSetup ( )

Definition at line 655 of file setup_common.cpp.

Member Function Documentation

◆ ConnectClient()

std::shared_ptr< DynSock::Pipes > SocketTestingSetup::ConnectClient ( std::span< const std::byte >  data)

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

Returns the I/O pipes from the mock client so we can read response data sent to it.

Definition at line 660 of file setup_common.cpp.

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 270 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 267 of file setup_common.h.


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