97 void *(*copy)(
void *p);
98 void (*destroy)(
void *p);
118 #define GRPC_ARG_ENABLE_CENSUS "grpc.census"
121 #define GRPC_ARG_MAX_CONCURRENT_STREAMS "grpc.max_concurrent_streams"
123 #define GRPC_ARG_MAX_MESSAGE_LENGTH "grpc.max_message_length"
125 #define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \
126 "grpc.http2.initial_sequence_number"
128 #define GRPC_ARG_DEFAULT_AUTHORITY "grpc.default_authority"
131 #define GRPC_ARG_PRIMARY_USER_AGENT_STRING "grpc.primary_user_agent"
134 #define GRPC_ARG_SECONDARY_USER_AGENT_STRING "grpc.secondary_user_agent"
142 #define GRPC_SSL_TARGET_NAME_OVERRIDE_ARG "grpc.ssl_target_name_override"
199 #define GRPC_WRITE_BUFFER_HINT (0x00000001u)
202 #define GRPC_WRITE_NO_COMPRESS (0x00000002u)
204 #define GRPC_WRITE_USED_MASK (GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS)
397 #define GRPC_PROPAGATE_DEADLINE ((gpr_uint32)1)
399 #define GRPC_PROPAGATE_CENSUS_STATS_CONTEXT ((gpr_uint32)2)
400 #define GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT ((gpr_uint32)4)
402 #define GRPC_PROPAGATE_CANCELLATION ((gpr_uint32)8)
409 #define GRPC_PROPAGATE_DEFAULTS \
411 0xffff | GRPC_PROPAGATE_DEADLINE | GRPC_PROPAGATE_CENSUS_STATS_CONTEXT | \
412 GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT | GRPC_PROPAGATE_CANCELLATION)))
463 #define GRPC_MAX_COMPLETION_QUEUE_PLUCKERS 6
501 const char *method,
const char *host,
506 const char *host,
void *reserved);
526 size_t nops,
void *tag,
void *reserved);
564 const char *error_message);
590 const char *description,
completion queue for notification has not been registered with the server
Definition: grpc.h:190
Operation completion.
Definition: grpc.h:228
void * tag
The tag passed to grpc_call_start_batch etc to start this operation.
Definition: grpc.h:242
grpc_op_type op
Operation type, as defined by grpc_op_type.
Definition: grpc.h:313
grpc_connectivity_state
Connectivity state of a channel.
Definition: grpc.h:145
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:281
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:373
grpc_op_type
Definition: grpc.h:266
gpr_uint32 flags
Write flags bitset for grpc_begin_messages.
Definition: grpc.h:315
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:339
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:111
grpc_arg * args
Definition: grpc.h:113
struct grpc_server grpc_server
A server listens to some port and responds to request calls.
Definition: grpc.h:63
grpc_arg_type
Type specifier for grpc_arg.
Definition: grpc.h:71
the flags value was illegal for this call
Definition: grpc.h:183
grpc_status_code status
Definition: grpc.h:331
gpr_timespec deadline
Definition: grpc.h:259
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:234
int integer
Definition: grpc.h:94
Send status from the server: one and only one instance MUST be sent from the server unless the call w...
Definition: grpc.h:287
char * string
Definition: grpc.h:93
void grpc_call_details_init(grpc_call_details *details)
char * host
Definition: grpc.h:257
int success
non-zero if the operation was successful, 0 upon failure.
Definition: grpc.h:239
void grpc_call_destroy(grpc_call *call)
Destroy a call.
size_t count
Definition: grpc.h:324
A single argument...
Definition: grpc.h:89
something failed, we don't know what
Definition: grpc.h:166
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc.h:68
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:343
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 * p
Definition: grpc.h:96
size_t * status_details_capacity
Definition: grpc.h:374
Receive a message: 0 or more of these operations can occur for each call.
Definition: grpc.h:296
size_t method_capacity
Definition: grpc.h:256
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:352
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:174
invalid message was passed to this call
Definition: grpc.h:187
Send initial metadata: one and only one instance MUST be sent for each call, unless the call was canc...
Definition: grpc.h:271
grpc_call_error
Result of a grpc call.
Definition: grpc.h:162
grpc_metadata * trailing_metadata
Definition: grpc.h:330
void grpc_server_cancel_all_calls(grpc_server *server)
Cancel all in-progress calls.
invalid metadata was passed to this call
Definition: grpc.h:185
const char * status_details
Definition: grpc.h:332
struct grpc_channel grpc_channel
The Channel interface allows creation of Call objects.
Definition: grpc.h:60
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:168
Shutting down.
Definition: grpc.h:224
Receive initial metadata: one and only one MUST be made on the client, must not be made on the server...
Definition: grpc.h:292
Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT which has no arguments) ...
Definition: grpc.h:311
void * reserved
Definition: grpc.h:260
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:275
everything went ok
Definition: grpc.h:164
this call is already finished (writes_done or write_status has already been called) ...
Definition: grpc.h:179
struct grpc_event grpc_event
The result of an operation.
grpc_completion_type
The type of completion (for grpc_event)
Definition: grpc.h:222
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:329
grpc_server * grpc_server_create(const grpc_channel_args *args, void *reserved)
Create a server.
size_t host_capacity
Definition: grpc.h:258
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:192
size_t num_args
Definition: grpc.h:112
Receive status on the client: one and only one must be made on the client.
Definition: grpc.h:302
channel is ready for work
Definition: grpc.h:151
char * key
Definition: grpc.h:91
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:153
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:170
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:147
channel has seen a failure that it cannot recover from
Definition: grpc.h:155
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:226
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' ...
void grpc_init(void)
Initialize the grpc library.
void * reserved
Reserved for future usage.
Definition: grpc.h:317
channel is connecting
Definition: grpc.h:149
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:327
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:351
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:181
Receive close on the server: one and only one must be made on the server.
Definition: grpc.h:306
grpc_completion_type type
The type of the completion.
Definition: grpc.h:236
this method must be called before server_accept
Definition: grpc.h:172
grpc_arg_type type
Definition: grpc.h:90
void grpc_completion_queue_shutdown(grpc_completion_queue *cq)
Begin destruction of a completion queue.
grpc_metadata * metadata
Definition: grpc.h:325
int * cancelled
out argument, set to 1 if the call failed in any way (seen as a cancellation on the server)...
Definition: grpc.h:379
this method must be called after invoke
Definition: grpc.h:176
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:255
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)