GRPC Core  9.0.0
Data Structures | Typedefs | Enumerations | Functions
channel_connectivity.cc File Reference
#include <grpc/support/port_platform.h>
#include "src/core/lib/surface/channel.h"
#include <inttypes.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/completion_queue.h"

Data Structures

struct  watcher_timer_init_arg
 

Typedefs

typedef struct watcher_timer_init_arg watcher_timer_init_arg
 

Enumerations

enum  callback_phase { WAITING, READY_TO_CALL_BACK, CALLING_BACK_AND_FINISHED }
 

Functions

grpc_connectivity_state grpc_channel_check_connectivity_state (grpc_channel *channel, int try_to_connect)
 Check the connectivity state of a channel. More...
 
int grpc_channel_num_external_connectivity_watchers (grpc_channel *channel)
 Number of active "external connectivity state watchers" attached to a channel. More...
 
int grpc_channel_support_connectivity_watcher (grpc_channel *channel)
 Check whether a grpc channel supports connectivity watcher. More...
 
void grpc_channel_watch_connectivity_state (grpc_channel *channel, grpc_connectivity_state last_observed_state, gpr_timespec deadline, grpc_completion_queue *cq, void *tag)
 Watch for a change in connectivity state. More...
 

Typedef Documentation

◆ watcher_timer_init_arg

Enumeration Type Documentation

◆ callback_phase

Enumerator
WAITING 
READY_TO_CALL_BACK 
CALLING_BACK_AND_FINISHED 

Function Documentation

◆ grpc_channel_check_connectivity_state()

grpc_connectivity_state grpc_channel_check_connectivity_state ( grpc_channel channel,
int  try_to_connect 
)

Check the connectivity state of a channel.

◆ grpc_channel_num_external_connectivity_watchers()

int grpc_channel_num_external_connectivity_watchers ( grpc_channel channel)

Number of active "external connectivity state watchers" attached to a channel.

Useful for testing.

◆ grpc_channel_support_connectivity_watcher()

int grpc_channel_support_connectivity_watcher ( grpc_channel channel)

Check whether a grpc channel supports connectivity watcher.

◆ grpc_channel_watch_connectivity_state()

void grpc_channel_watch_connectivity_state ( grpc_channel channel,
grpc_connectivity_state  last_observed_state,
gpr_timespec  deadline,
grpc_completion_queue cq,
void *  tag 
)

Watch for a change in connectivity state.

Once the channel connectivity state is different from last_observed_state, tag will be enqueued on cq with success=1. If deadline expires BEFORE the state is changed, tag will be enqueued on cq with success=0.