100 void *(*copy)(
void *p);
101 void (*destroy)(
void *p);
121 #define GRPC_ARG_ENABLE_CENSUS "grpc.census"
124 #define GRPC_ARG_MAX_CONCURRENT_STREAMS "grpc.max_concurrent_streams"
126 #define GRPC_ARG_MAX_MESSAGE_LENGTH "grpc.max_message_length"
128 #define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \
129 "grpc.http2.initial_sequence_number"
134 #define GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES "grpc.http2.lookahead_bytes"
136 #define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER \
137 "grpc.http2.hpack_table_size.decoder"
139 #define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER \
140 "grpc.http2.hpack_table_size.encoder"
142 #define GRPC_ARG_DEFAULT_AUTHORITY "grpc.default_authority"
145 #define GRPC_ARG_PRIMARY_USER_AGENT_STRING "grpc.primary_user_agent"
148 #define GRPC_ARG_SECONDARY_USER_AGENT_STRING "grpc.secondary_user_agent"
156 #define GRPC_SSL_TARGET_NAME_OVERRIDE_ARG "grpc.ssl_target_name_override"
213 #define GRPC_WRITE_BUFFER_HINT (0x00000001u)
216 #define GRPC_WRITE_NO_COMPRESS (0x00000002u)
218 #define GRPC_WRITE_USED_MASK (GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS)
411 #define GRPC_PROPAGATE_DEADLINE ((gpr_uint32)1)
413 #define GRPC_PROPAGATE_CENSUS_STATS_CONTEXT ((gpr_uint32)2)
414 #define GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT ((gpr_uint32)4)
416 #define GRPC_PROPAGATE_CANCELLATION ((gpr_uint32)8)
423 #define GRPC_PROPAGATE_DEFAULTS \
425 0xffff | GRPC_PROPAGATE_DEADLINE | GRPC_PROPAGATE_CENSUS_STATS_CONTEXT | \
426 GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT | GRPC_PROPAGATE_CANCELLATION)))
477 #define GRPC_MAX_COMPLETION_QUEUE_PLUCKERS 6
531 const char *method,
const char *host,
537 void *tag,
void *reserved);
541 const char *host,
void *reserved);
561 size_t nops,
void *tag,
void *reserved);
599 const char *error_message);
625 const char *description,
completion queue for notification has not been registered with the server
Definition: grpc.h:204
Operation completion.
Definition: grpc.h:242
void * tag
The tag passed to grpc_call_start_batch etc to start this operation.
Definition: grpc.h:256
grpc_op_type op
Operation type, as defined by grpc_op_type.
Definition: grpc.h:327
grpc_connectivity_state
Connectivity state of a channel.
Definition: grpc.h:159
Send a close from the client: one and only one instance MUST be sent from the client, unless the call was cancelled - in which case this can be skipped.
Definition: grpc.h:295
void grpc_server_destroy(grpc_server *server)
Destroy a server.
char ** status_details
status_details is a buffer owned by the application before the op completes and after the op has comp...
Definition: grpc.h:387
grpc_op_type
Definition: grpc.h:280
gpr_uint32 flags
Write flags bitset for grpc_begin_messages.
Definition: grpc.h:329
struct grpc_op grpc_op
Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT which has no arguments) ...
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.
grpc_metadata_array * recv_initial_metadata
ownership of the array is with the caller, but ownership of the elements stays with the call object (...
Definition: grpc.h:353
grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, void *tag, gpr_timespec deadline, void *reserved)
Blocks until an event with tag 'tag' is available, the completion queue is being shutdown or deadline...
struct grpc_completion_queue grpc_completion_queue
Completion Queues enable notification of the completion of asynchronous actions.
Definition: grpc.h:57
void grpc_call_details_destroy(grpc_call_details *details)
An array of arguments that can be passed around.
Definition: grpc.h:114
grpc_arg * args
Definition: grpc.h:116
struct grpc_server grpc_server
A server listens to some port and responds to request calls.
Definition: grpc.h:66
grpc_arg_type
Type specifier for grpc_arg.
Definition: grpc.h:74
the flags value was illegal for this call
Definition: grpc.h:197
grpc_status_code status
Definition: grpc.h:345
gpr_timespec deadline
Definition: grpc.h:273
grpc_channel * grpc_lame_client_channel_create(const char *target, grpc_status_code error_code, const char *error_message)
Create a lame client: this client fails every operation attempted on it.
The result of an operation.
Definition: grpc.h:248
int integer
Definition: grpc.h:97
int grpc_is_binary_header(const char *key, size_t length)
Check whether a metadata key corresponds to a binary value.
Send status from the server: one and only one instance MUST be sent from the server unless the call w...
Definition: grpc.h:301
char * string
Definition: grpc.h:96
void grpc_call_details_init(grpc_call_details *details)
char * host
Definition: grpc.h:271
int success
non-zero if the operation was successful, 0 upon failure.
Definition: grpc.h:253
void grpc_call_destroy(grpc_call *call)
Destroy a call.
size_t count
Definition: grpc.h:338
A single argument...
Definition: grpc.h:92
something failed, we don't know what
Definition: grpc.h:180
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc.h:71
Definition: byte_buffer.h:49
grpc_byte_buffer ** recv_message
ownership of the byte buffer is moved to the caller; the caller must call grpc_byte_buffer_destroy on...
Definition: grpc.h:357
grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved)
Called by clients to cancel an RPC on the server.
void grpc_server_start(grpc_server *server)
Start a server - tells all listeners to start listening.
void grpc_channel_ping(grpc_channel *channel, grpc_completion_queue *cq, void *tag, void *reserved)
Ping the channels peer (load balanced channels will select one sub-channel to ping); if the channel i...
void * p
Definition: grpc.h:99
size_t * status_details_capacity
Definition: grpc.h:388
Receive a message: 0 or more of these operations can occur for each call.
Definition: grpc.h:310
size_t method_capacity
Definition: grpc.h:270
grpc_connectivity_state grpc_channel_check_connectivity_state(grpc_channel *channel, int try_to_connect)
Check the connectivity state of a channel.
grpc_status_code * status
Definition: grpc.h:366
struct grpc_alarm grpc_alarm
An alarm associated with a completion queue.
Definition: grpc.h:60
void grpc_server_shutdown_and_notify(grpc_server *server, grpc_completion_queue *cq, void *tag)
Begin shutting down a server.
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.
this method must be called before invoke
Definition: grpc.h:188
invalid message was passed to this call
Definition: grpc.h:201
Send initial metadata: one and only one instance MUST be sent for each call, unless the call was canc...
Definition: grpc.h:285
grpc_call_error
Result of a grpc call.
Definition: grpc.h:176
grpc_metadata * trailing_metadata
Definition: grpc.h:344
void grpc_server_cancel_all_calls(grpc_server *server)
Cancel all in-progress calls.
invalid metadata was passed to this call
Definition: grpc.h:199
const char * status_details
Definition: grpc.h:346
struct grpc_channel grpc_channel
The Channel interface allows creation of Call objects.
Definition: grpc.h:63
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'.
grpc_completion_queue * grpc_completion_queue_create(void *reserved)
Create a completion queue.
struct grpc_op::@7::@10 send_status_from_server
struct grpc_op::@7::@9 send_initial_metadata
this method is not available on the server
Definition: grpc.h:182
Shutting down.
Definition: grpc.h:238
Receive initial metadata: one and only one MUST be made on the client, must not be made on the server...
Definition: grpc.h:306
Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT which has no arguments) ...
Definition: grpc.h:325
void * reserved
Definition: grpc.h:274
grpc_call_error grpc_server_request_call(grpc_server *server, grpc_call **call, grpc_call_details *details, grpc_metadata_array *request_metadata, grpc_completion_queue *cq_bound_to_call, grpc_completion_queue *cq_for_notification, void *tag_new)
Request notification of a new call.
Send a message: 0 or more of these operations can occur for each call.
Definition: grpc.h:289
int grpc_header_nonbin_value_is_legal(const char *value, size_t length)
Check whether a non-binary metadata value is legal (will be accepted by core)
everything went ok
Definition: grpc.h:178
this call is already finished (writes_done or write_status has already been called) ...
Definition: grpc.h:193
void grpc_alarm_destroy(grpc_alarm *alarm)
Destroy the given completion queue alarm, cancelling it in the process.
struct grpc_event grpc_event
The result of an operation.
grpc_completion_type
The type of completion (for grpc_event)
Definition: grpc.h:236
void grpc_server_register_completion_queue(grpc_server *server, grpc_completion_queue *cq, void *reserved)
Register a completion queue with the server.
size_t trailing_metadata_count
Definition: grpc.h:343
grpc_server * grpc_server_create(const grpc_channel_args *args, void *reserved)
Create a server.
size_t host_capacity
Definition: grpc.h:272
void * grpc_server_register_method(grpc_server *server, const char *method, const char *host)
Registers a method in the server.
char * grpc_channel_get_target(grpc_channel *channel)
Return a newly allocated string representing the target a channel was created for.
void grpc_channel_destroy(grpc_channel *channel)
Close and destroy a grpc channel.
const char * grpc_version_string(void)
Return a string representing the current version of grpc.
this batch of operations leads to more operations than allowed
Definition: grpc.h:206
int grpc_header_key_is_legal(const char *key, size_t length)
Check whether a metadata key is legal (will be accepted by core)
size_t num_args
Definition: grpc.h:115
void grpc_alarm_cancel(grpc_alarm *alarm)
Cancel a completion queue alarm.
Receive status on the client: one and only one must be made on the client.
Definition: grpc.h:316
channel is ready for work
Definition: grpc.h:165
char * key
Definition: grpc.h:94
char * grpc_call_get_peer(grpc_call *call)
Returns a newly allocated string representing the endpoint to which this call is communicating with...
struct grpc_op::@7::@11 recv_status_on_client
channel has seen a failure but expects to recover
Definition: grpc.h:167
grpc_channel * grpc_insecure_channel_create(const char *target, const grpc_channel_args *args, void *reserved)
Create a client channel to 'target'.
struct grpc_metadata grpc_metadata
A single metadata element.
this method is not available on the client
Definition: grpc.h:184
void grpc_register_plugin(void(*init)(void), void(*destroy)(void))
Registers a plugin to be initialized and destroyed with the library.
channel is idle
Definition: grpc.h:161
channel has seen a failure that it cannot recover from
Definition: grpc.h:169
int grpc_server_add_insecure_http2_port(grpc_server *server, const char *addr)
Add a HTTP2 over plaintext over tcp listener.
grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, gpr_timespec deadline, void *reserved)
Blocks until an event is available, the completion queue is being shut down, or deadline is reached...
grpc_status_code
Definition: status.h:41
struct census_context * grpc_census_call_get_context(grpc_call *call)
void grpc_metadata_array_destroy(grpc_metadata_array *array)
No event before timeout.
Definition: grpc.h:240
grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops, size_t nops, void *tag, void *reserved)
Start a batch of operations defined in the array ops; when complete, post a completion of type 'tag' ...
grpc_alarm * grpc_alarm_create(grpc_completion_queue *cq, gpr_timespec deadline, void *tag)
Create a completion queue alarm instance associated to cq.
void grpc_init(void)
Initialize the grpc library.
void * reserved
Reserved for future usage.
Definition: grpc.h:331
channel is connecting
Definition: grpc.h:163
grpc_call_error grpc_call_cancel_with_status(grpc_call *call, grpc_status_code status, const char *description, void *reserved)
Called by clients to cancel an RPC on the server.
grpc_byte_buffer * send_message
Definition: grpc.h:341
grpc_metadata_array * trailing_metadata
ownership of the array is with the caller, but ownership of the elements stays with the call object (...
Definition: grpc.h:365
grpc_call_error grpc_server_request_registered_call(grpc_server *server, void *registered_method, grpc_call **call, gpr_timespec *deadline, grpc_metadata_array *request_metadata, grpc_byte_buffer **optional_payload, grpc_completion_queue *cq_bound_to_call, grpc_completion_queue *cq_for_notification, void *tag_new)
Request notification of a new pre-registered call.
void grpc_shutdown(void)
Shut down the grpc library.
void grpc_metadata_array_init(grpc_metadata_array *array)
void grpc_completion_queue_destroy(grpc_completion_queue *cq)
Destroy a completion queue.
there is already an outstanding read/write operation on the call
Definition: grpc.h:195
Receive close on the server: one and only one must be made on the server.
Definition: grpc.h:320
grpc_completion_type type
The type of the completion.
Definition: grpc.h:250
this method must be called before server_accept
Definition: grpc.h:186
grpc_arg_type type
Definition: grpc.h:93
void grpc_completion_queue_shutdown(grpc_completion_queue *cq)
Begin destruction of a completion queue.
grpc_metadata * metadata
Definition: grpc.h:339
int * cancelled
out argument, set to 1 if the call failed in any way (seen as a cancellation on the server)...
Definition: grpc.h:393
this method must be called after invoke
Definition: grpc.h:190
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.
char * method
Definition: grpc.h:269
struct census_context census_context
Context is a handle used by census to represent the current tracing and tagging information.
Definition: census.h:80
struct grpc_op::@7::@12 recv_close_on_server
int grpc_tracer_set_enabled(const char *name, int enabled)
Enable or disable a tracer.
void grpc_census_call_set_context(grpc_call *call, struct census_context *context)