Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
grpc_core::HandshakeManager Class Reference

#include <handshaker.h>

Inheritance diagram for grpc_core::HandshakeManager:
Inheritance graph
[legend]

Public Member Functions

void Add (RefCountedPtr< Handshaker > handshaker)
 
void DoHandshake (grpc_endpoint *endpoint, const grpc_channel_args *channel_args, Timestamp deadline, grpc_tcp_server_acceptor *acceptor, grpc_iomgr_cb_func on_handshake_done, void *user_data)
 
 HandshakeManager ()
 
void Shutdown (grpc_error_handle why)
 
 ~HandshakeManager () override
 
- Public Member Functions inherited from grpc_core::RefCounted< HandshakeManager >
RefCountedoperator= (const RefCounted &)=delete
 
RefCountedPtr< HandshakeManagerRef () GRPC_MUST_USE_RESULT
 
RefCountedPtr< HandshakeManagerRef (const DebugLocation &location, const char *reason) GRPC_MUST_USE_RESULT
 
 RefCounted (const RefCounted &)=delete
 
RefCountedPtr< HandshakeManagerRefIfNonZero () GRPC_MUST_USE_RESULT
 
RefCountedPtr< HandshakeManagerRefIfNonZero (const DebugLocation &location, const char *reason) GRPC_MUST_USE_RESULT
 
void Unref ()
 
void Unref (const DebugLocation &location, const char *reason)
 
 ~RefCounted ()=default
 
- Public Member Functions inherited from grpc_core::PolymorphicRefCount
virtual ~PolymorphicRefCount ()=default
 

Private Member Functions

bool CallNextHandshakerLocked (grpc_error_handle error)
 

Static Private Member Functions

static void CallNextHandshakerFn (void *arg, grpc_error_handle error)
 
static void OnTimeoutFn (void *arg, grpc_error_handle error)
 

Private Attributes

grpc_tcp_server_acceptoracceptor_
 
HandshakerArgs args_
 
grpc_closure call_next_handshaker_
 
grpc_timer deadline_timer_
 
absl::InlinedVector< RefCountedPtr< Handshaker >, HANDSHAKERS_INIT_SIZEhandshakers_
 
size_t index_ = 0
 
bool is_shutdown_ = false
 
Mutex mu_
 
grpc_closure on_handshake_done_
 
grpc_closure on_timeout_
 

Static Private Attributes

static const size_t HANDSHAKERS_INIT_SIZE = 2
 

Additional Inherited Members

- Public Types inherited from grpc_core::RefCounted< HandshakeManager >
using RefCountedChildType = HandshakeManager
 
- Protected Member Functions inherited from grpc_core::RefCounted< HandshakeManager >
 RefCounted (const char *trace=nullptr, intptr_t initial_refcount=1)
 

Detailed Description

Definition at line 98 of file handshaker.h.

Constructor & Destructor Documentation

◆ HandshakeManager()

grpc_core::HandshakeManager::HandshakeManager ( )

Definition at line 61 of file src/core/lib/transport/handshaker.cc.

◆ ~HandshakeManager()

grpc_core::HandshakeManager::~HandshakeManager ( )
override

Definition at line 74 of file src/core/lib/transport/handshaker.cc.

Member Function Documentation

◆ Add()

void grpc_core::HandshakeManager::Add ( RefCountedPtr< Handshaker handshaker)

Adds a handshaker to the handshake manager. Takes ownership of handshaker.

Definition at line 63 of file src/core/lib/transport/handshaker.cc.

◆ CallNextHandshakerFn()

void grpc_core::HandshakeManager::CallNextHandshakerFn ( void *  arg,
grpc_error_handle  error 
)
staticprivate

Definition at line 150 of file src/core/lib/transport/handshaker.cc.

◆ CallNextHandshakerLocked()

bool grpc_core::HandshakeManager::CallNextHandshakerLocked ( grpc_error_handle  error)
private

Definition at line 91 of file src/core/lib/transport/handshaker.cc.

◆ DoHandshake()

void grpc_core::HandshakeManager::DoHandshake ( grpc_endpoint endpoint,
const grpc_channel_args channel_args,
Timestamp  deadline,
grpc_tcp_server_acceptor acceptor,
grpc_iomgr_cb_func  on_handshake_done,
void *  user_data 
)

Invokes handshakers in the order they were added. Takes ownership of endpoint, and then passes that ownership to the on_handshake_done callback. Does NOT take ownership of channel_args. Instead, makes a copy before invoking the first handshaker. acceptor will be nullptr for client-side handshakers.

When done, invokes on_handshake_done with a HandshakerArgs object as its argument. If the callback is invoked with error != GRPC_ERROR_NONE, then handshaking failed and the handshaker has done the necessary clean-up. Otherwise, the callback takes ownership of the arguments.

Definition at line 174 of file src/core/lib/transport/handshaker.cc.

◆ OnTimeoutFn()

void grpc_core::HandshakeManager::OnTimeoutFn ( void *  arg,
grpc_error_handle  error 
)
staticprivate

Definition at line 166 of file src/core/lib/transport/handshaker.cc.

◆ Shutdown()

void grpc_core::HandshakeManager::Shutdown ( grpc_error_handle  why)

Shuts down the handshake manager (e.g., to clean up when the operation is aborted in the middle).

Definition at line 76 of file src/core/lib/transport/handshaker.cc.

Member Data Documentation

◆ acceptor_

grpc_tcp_server_acceptor* grpc_core::HandshakeManager::acceptor_
private

Definition at line 149 of file handshaker.h.

◆ args_

HandshakerArgs grpc_core::HandshakeManager::args_
private

Definition at line 156 of file handshaker.h.

◆ call_next_handshaker_

grpc_closure grpc_core::HandshakeManager::call_next_handshaker_
private

Definition at line 147 of file handshaker.h.

◆ deadline_timer_

grpc_timer grpc_core::HandshakeManager::deadline_timer_
private

Definition at line 151 of file handshaker.h.

◆ handshakers_

absl::InlinedVector<RefCountedPtr<Handshaker>, HANDSHAKERS_INIT_SIZE> grpc_core::HandshakeManager::handshakers_
private

Definition at line 144 of file handshaker.h.

◆ HANDSHAKERS_INIT_SIZE

const size_t grpc_core::HandshakeManager::HANDSHAKERS_INIT_SIZE = 2
staticprivate

Definition at line 138 of file handshaker.h.

◆ index_

size_t grpc_core::HandshakeManager::index_ = 0
private

Definition at line 146 of file handshaker.h.

◆ is_shutdown_

bool grpc_core::HandshakeManager::is_shutdown_ = false
private

Definition at line 141 of file handshaker.h.

◆ mu_

Mutex grpc_core::HandshakeManager::mu_
private

Definition at line 140 of file handshaker.h.

◆ on_handshake_done_

grpc_closure grpc_core::HandshakeManager::on_handshake_done_
private

Definition at line 154 of file handshaker.h.

◆ on_timeout_

grpc_closure grpc_core::HandshakeManager::on_timeout_
private

Definition at line 152 of file handshaker.h.


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


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:36