Bitcoin Core 29.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
mp::ProxyClient< Thread > Struct Reference

#include <proxy-io.h>

Inheritance diagram for mp::ProxyClient< Thread >:
[legend]
Collaboration diagram for mp::ProxyClient< Thread >:
[legend]

Public Member Functions

 ProxyClient (const ProxyClient &)=delete
 
 ~ProxyClient ()
 
void setDisconnectCallback (const std::function< void()> &fn)
 
 ProxyClientBase (typename Interface::Client client, Connection *connection, bool destroy_connection)
 Construct libmultiprocess client object wrapping Cap'n Proto client object with a reference to the associated mp::Connection object. More...
 
- Public Member Functions inherited from mp::ProxyClientBase< Thread, ::capnp::Void >
 ProxyClientBase (typename Interface::Client client, Connection *connection, bool destroy_connection)
 Construct libmultiprocess client object wrapping Cap'n Proto client object with a reference to the associated mp::Connection object. More...
 
 ~ProxyClientBase () noexcept
 

Public Attributes

std::optional< CleanupItm_disconnect_cb
 Reference to callback function that is run if there is a sudden disconnect and the Connection object is destroyed before this ProxyClient<Thread> object. More...
 
- Public Attributes inherited from mp::ProxyClientBase< Thread, ::capnp::Void >
Interface::Client m_client
 
ProxyContext m_context
 

Additional Inherited Members

- Public Types inherited from mp::ProxyClientBase< Thread, ::capnp::Void >
using Interface = Thread
 
using Impl = ::capnp::Void
 
using Sub = ProxyClient< Interface >
 
using Super = ProxyClientBase< Interface, Impl >
 
- Static Public Member Functions inherited from mp::ProxyClientBase< Thread, ::capnp::Void >
static void construct (Super &)
 
static void destroy (Super &)
 

Detailed Description

Definition at line 62 of file proxy-io.h.

Constructor & Destructor Documentation

◆ ProxyClient()

mp::ProxyClient< Thread >::ProxyClient ( const ProxyClient< Thread > &  )
delete

◆ ~ProxyClient()

mp::ProxyClient< Thread >::~ProxyClient ( )

Definition at line 333 of file proxy.cpp.

Member Function Documentation

◆ ProxyClientBase()

mp::ProxyClientBase< Interface, Impl >::ProxyClientBase ( typename Interface::Client  client,
Connection connection,
bool  destroy_connection 
)

Construct libmultiprocess client object wrapping Cap'n Proto client object with a reference to the associated mp::Connection object.

The destroy_connection option determines whether destroying this client object closes the connection. It is set to true for the ProxyClient<InitInterface> object returned by ConnectStream, to let IPC clients close the connection by freeing the object. It is false for other client objects so they can be destroyed without affecting the connection.

Definition at line 97 of file proxy-io.h.

◆ setDisconnectCallback()

void mp::ProxyClient< Thread >::setDisconnectCallback ( const std::function< void()> &  fn)

Definition at line 343 of file proxy.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ m_disconnect_cb

std::optional<CleanupIt> mp::ProxyClient< Thread >::m_disconnect_cb

Reference to callback function that is run if there is a sudden disconnect and the Connection object is destroyed before this ProxyClient<Thread> object.

The callback will destroy this object and remove its entry from the thread's request_threads or callback_threads map. It will also reset m_disconnect_cb so the destructor does not access it. In the normal case where there is no sudden disconnect, the destructor will unregister m_disconnect_cb so the callback is never run. Since this variable is accessed from multiple threads, accesses should be guarded with the associated Waiter::m_mutex.

Definition at line 80 of file proxy-io.h.


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