![]() |
Bitcoin Core 30.99.0
P2P Digital Currency
|
#include <mp/proxy.h>#include <mp/util.h>#include <mp/proxy.capnp.h>#include <capnp/rpc-twoparty.h>#include <assert.h>#include <condition_variable>#include <functional>#include <kj/function.h>#include <map>#include <memory>#include <optional>#include <sstream>#include <string>#include <thread>Go to the source code of this file.
Classes | |
| struct | mp::InvokeContext |
| struct | mp::ClientInvokeContext |
| struct | mp::ServerInvokeContext< ProxyServer, CallContext_ > |
| struct | mp::ProxyClient< Thread > |
| struct | mp::ProxyServer< Thread > |
| class | mp::LoggingErrorHandler |
| Handler for kj::TaskSet failed task events. More... | |
| struct | mp::LogMessage |
| struct | mp::LogOptions |
| class | mp::Logger |
| class | mp::EventLoop |
| Event loop implementation. More... | |
| struct | mp::Waiter |
| Single element task queue used to handle recursive capnp calls. More... | |
| class | mp::Connection |
| Object holding network & rpc state associated with either an incoming server connection, or an outgoing client connection. More... | |
| struct | mp::ServerVatId |
| Vat id for server side of connection. More... | |
| struct | mp::ThreadContext |
| The thread_local ThreadContext g_thread_context struct provides information about individual threads and a way of communicating between them. More... | |
Namespaces | |
| namespace | mp |
| Functions to serialize / deserialize common bitcoin types. | |
Macros | |
| #define | MP_LOGPLAIN(loop, ...) if (mp::Logger logger{(loop).m_log_opts, __VA_ARGS__}; logger) logger |
| #define | MP_LOG(loop, ...) MP_LOGPLAIN(loop, __VA_ARGS__) << "{" << LongThreadName((loop).m_exe_name) << "} " |
Typedefs | |
| template<typename Interface , typename Params , typename Results > | |
| using | mp::ServerContext = ServerInvokeContext< ProxyServer< Interface >, ::capnp::CallContext< Params, Results > > |
| using | mp::LogFn = std::function< void(LogMessage)> |
| using | mp::ConnThreads = std::map< Connection *, std::optional< ProxyClient< Thread > > > |
| Map from Connection to local or remote thread handle which will be used over that connection. More... | |
| using | mp::ConnThread = ConnThreads::iterator |
Enumerations | |
| enum class | mp::Log { mp::Trace = 0 , mp::Debug , mp::Info , mp::Warning , mp::Error , mp::Raise } |
| Log flags. Update stringify function if changed! More... | |
Functions | |
| kj::StringPtr | mp::KJ_STRINGIFY (Log flags) |
| std::string | mp::LongThreadName (const char *exe_name) |
| std::tuple< ConnThread, bool > | mp::SetThread (GuardedRef< ConnThreads > threads, Connection *connection, const std::function< Thread::Client()> &make_thread) |
| template<typename InitInterface > | |
| std::unique_ptr< ProxyClient< InitInterface > > | mp::ConnectStream (EventLoop &loop, int fd) |
| Given stream file descriptor, make a new ProxyClient object to send requests over the stream. More... | |
| template<typename InitInterface , typename InitImpl > | |
| void | mp::_Serve (EventLoop &loop, kj::Own< kj::AsyncIoStream > &&stream, InitImpl &init) |
| Given stream and init objects, construct a new ProxyServer object that handles requests from the stream by calling the init object. More... | |
| template<typename InitInterface , typename InitImpl > | |
| void | mp::_Listen (EventLoop &loop, kj::Own< kj::ConnectionReceiver > &&listener, InitImpl &init) |
| Given connection receiver and an init object, handle incoming connections by calling _Serve, to create ProxyServer objects and forward requests to the init object. More... | |
| template<typename InitInterface , typename InitImpl > | |
| void | mp::ServeStream (EventLoop &loop, int fd, InitImpl &init) |
| Given stream file descriptor and an init object, handle requests on the stream by calling methods on the Init object. More... | |
| template<typename InitInterface , typename InitImpl > | |
| void | mp::ListenConnections (EventLoop &loop, int fd, InitImpl &init) |
| Given listening socket file descriptor and an init object, handle incoming connections and requests by calling methods on the Init object. More... | |
Variables | |
| thread_local ThreadContext | mp::g_thread_context |
| #define MP_LOG | ( | loop, | |
| ... | |||
| ) | MP_LOGPLAIN(loop, __VA_ARGS__) << "{" << LongThreadName((loop).m_exe_name) << "} " |
Definition at line 184 of file proxy-io.h.
| #define MP_LOGPLAIN | ( | loop, | |
| ... | |||
| ) | if (mp::Logger logger{(loop).m_log_opts, __VA_ARGS__}; logger) logger |
Definition at line 182 of file proxy-io.h.