GRPC Core
0.11.0.0
|
#include "src/core/surface/channel.h"
#include <stdlib.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/client_config/resolver_registry.h"
#include "src/core/iomgr/iomgr.h"
#include "src/core/surface/call.h"
#include "src/core/surface/init.h"
Data Structures | |
struct | registered_call |
struct | grpc_channel |
Macros | |
#define | NUM_CACHED_STATUS_ELEMS 3 |
Cache grpc-status: X mdelems for X = 0..NUM_CACHED_STATUS_ELEMS. More... | |
#define | CHANNEL_STACK_FROM_CHANNEL(c) ((grpc_channel_stack *)((c) + 1)) |
#define | CHANNEL_FROM_CHANNEL_STACK(channel_stack) (((grpc_channel *)(channel_stack)) - 1) |
#define | CHANNEL_FROM_TOP_ELEM(top_elem) CHANNEL_FROM_CHANNEL_STACK(grpc_channel_stack_from_top_element(top_elem)) |
#define | DEFAULT_MAX_MESSAGE_LENGTH (100 * 1024 * 1024) |
Typedefs | |
typedef struct registered_call | registered_call |
Functions | |
grpc_channel * | grpc_channel_create_from_filters (const char *target, const grpc_channel_filter **filters, size_t num_filters, const grpc_channel_args *args, grpc_mdctx *mdctx, int is_client) |
char * | grpc_channel_get_target (grpc_channel *channel) |
Return a newly allocated string representing the target a channel was created for. More... | |
grpc_call * | grpc_channel_create_call (grpc_channel *channel, grpc_call *parent_call, gpr_uint32 propagation_mask, grpc_completion_queue *cq, const char *method, const char *host, gpr_timespec deadline, void *reserved) |
Create a call given a grpc_channel, in order to call 'method'. More... | |
void * | grpc_channel_register_call (grpc_channel *channel, const char *method, const char *host, void *reserved) |
Pre-register a method/host pair on a channel. More... | |
grpc_call * | grpc_channel_create_registered_call (grpc_channel *channel, grpc_call *parent_call, gpr_uint32 propagation_mask, grpc_completion_queue *completion_queue, void *registered_call_handle, gpr_timespec deadline, void *reserved) |
Create a call given a handle returned from grpc_channel_register_call. More... | |
void | grpc_channel_internal_ref (grpc_channel *c) |
void | grpc_channel_internal_unref (grpc_channel *channel) |
void | grpc_channel_destroy (grpc_channel *channel) |
Close and destroy a grpc channel. More... | |
grpc_channel_stack * | grpc_channel_get_channel_stack (grpc_channel *channel) |
Get a (borrowed) pointer to this channels underlying channel stack. More... | |
grpc_mdctx * | grpc_channel_get_metadata_context (grpc_channel *channel) |
Get a (borrowed) pointer to the channel wide metadata context. More... | |
grpc_mdstr * | grpc_channel_get_status_string (grpc_channel *channel) |
grpc_mdstr * | grpc_channel_get_compression_algorithm_string (grpc_channel *channel) |
grpc_mdstr * | grpc_channel_get_encodings_accepted_by_peer_string (grpc_channel *channel) |
grpc_mdelem * | grpc_channel_get_reffed_status_elem (grpc_channel *channel, int i) |
Get a grpc_mdelem of grpc-status: X where X is the numeric value of status_code. More... | |
grpc_mdstr * | grpc_channel_get_message_string (grpc_channel *channel) |
gpr_uint32 | grpc_channel_get_max_message_length (grpc_channel *channel) |
#define CHANNEL_FROM_CHANNEL_STACK | ( | channel_stack | ) | (((grpc_channel *)(channel_stack)) - 1) |
#define CHANNEL_FROM_TOP_ELEM | ( | top_elem | ) | CHANNEL_FROM_CHANNEL_STACK(grpc_channel_stack_from_top_element(top_elem)) |
#define CHANNEL_STACK_FROM_CHANNEL | ( | c | ) | ((grpc_channel_stack *)((c) + 1)) |
#define DEFAULT_MAX_MESSAGE_LENGTH (100 * 1024 * 1024) |
#define NUM_CACHED_STATUS_ELEMS 3 |
Cache grpc-status: X mdelems for X = 0..NUM_CACHED_STATUS_ELEMS.
Avoids needing to take a metadata context lock for sending status if the status code is <= NUM_CACHED_STATUS_ELEMS. Sized to allow the most commonly used codes to fit in (OK, Cancelled, Unknown).
typedef struct registered_call registered_call |
grpc_call* grpc_channel_create_call | ( | grpc_channel * | channel, |
grpc_call * | parent_call, | ||
gpr_uint32 | propagation_mask, | ||
grpc_completion_queue * | completion_queue, | ||
const char * | method, | ||
const char * | host, | ||
gpr_timespec | deadline, | ||
void * | reserved | ||
) |
Create a call given a grpc_channel, in order to call 'method'.
All completions are sent to 'completion_queue'. 'method' and 'host' need only live through the invocation of this function. If parent_call is non-NULL, it must be a server-side call. It will be used to propagate properties from the server call to this new client call.
grpc_channel* grpc_channel_create_from_filters | ( | const char * | target, |
const grpc_channel_filter ** | filters, | ||
size_t | num_filters, | ||
const grpc_channel_args * | args, | ||
grpc_mdctx * | mdctx, | ||
int | is_client | ||
) |
grpc_call* grpc_channel_create_registered_call | ( | grpc_channel * | channel, |
grpc_call * | parent_call, | ||
gpr_uint32 | propagation_mask, | ||
grpc_completion_queue * | completion_queue, | ||
void * | registered_call_handle, | ||
gpr_timespec | deadline, | ||
void * | reserved | ||
) |
Create a call given a handle returned from grpc_channel_register_call.
void grpc_channel_destroy | ( | grpc_channel * | channel | ) |
Close and destroy a grpc channel.
grpc_channel_stack* grpc_channel_get_channel_stack | ( | grpc_channel * | channel | ) |
Get a (borrowed) pointer to this channels underlying channel stack.
grpc_mdstr* grpc_channel_get_compression_algorithm_string | ( | grpc_channel * | channel | ) |
grpc_mdstr* grpc_channel_get_encodings_accepted_by_peer_string | ( | grpc_channel * | channel | ) |
gpr_uint32 grpc_channel_get_max_message_length | ( | grpc_channel * | channel | ) |
grpc_mdstr* grpc_channel_get_message_string | ( | grpc_channel * | channel | ) |
grpc_mdctx* grpc_channel_get_metadata_context | ( | grpc_channel * | channel | ) |
Get a (borrowed) pointer to the channel wide metadata context.
grpc_mdelem* grpc_channel_get_reffed_status_elem | ( | grpc_channel * | channel, |
int | status_code | ||
) |
Get a grpc_mdelem of grpc-status: X where X is the numeric value of status_code.
The returned elem is owned by the caller.
grpc_mdstr* grpc_channel_get_status_string | ( | grpc_channel * | channel | ) |
char* grpc_channel_get_target | ( | grpc_channel * | channel | ) |
Return a newly allocated string representing the target a channel was created for.
void grpc_channel_internal_ref | ( | grpc_channel * | c | ) |
void grpc_channel_internal_unref | ( | grpc_channel * | channel | ) |
void* grpc_channel_register_call | ( | grpc_channel * | channel, |
const char * | method, | ||
const char * | host, | ||
void * | reserved | ||
) |
Pre-register a method/host pair on a channel.