GRPC Core 0.10.0.0

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
grpc.h
Go to the documentation of this file.
1 /*
2 *
3 * Copyright 2015, Google Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 *
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above
13 * copyright notice, this list of conditions and the following disclaimer
14 * in the documentation and/or other materials provided with the
15 * distribution.
16 * * Neither the name of Google Inc. nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33
34 #ifndef GRPC_GRPC_H
35 #define GRPC_GRPC_H
36
37 #include <grpc/status.h>
38
39 #include <stddef.h>
40 #include <grpc/byte_buffer.h>
41 #include <grpc/support/slice.h>
42 #include <grpc/support/time.h>
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47
59 typedef struct grpc_completion_queue grpc_completion_queue;
60
62 typedef struct grpc_channel grpc_channel;
63
65 typedef struct grpc_server grpc_server;
66
70 typedef struct grpc_call grpc_call;
71
73 typedef enum {
74 GRPC_ARG_STRING,
75 GRPC_ARG_INTEGER,
76 GRPC_ARG_POINTER
77 } grpc_arg_type;
78
91 typedef struct {
92 grpc_arg_type type;
93 char *key;
94 union {
95 char *string;
96 int integer;
97 struct {
98 void *p;
99 void *(*copy)(void *p);
100 void (*destroy)(void *p);
101 } pointer;
102 } value;
103 } grpc_arg;
104
113 typedef struct {
114 size_t num_args;
115 grpc_arg *args;
116 } grpc_channel_args;
117
118 /* Channel argument keys: */
120 #define GRPC_ARG_ENABLE_CENSUS "grpc.census"
121
123 #define GRPC_ARG_MAX_CONCURRENT_STREAMS "grpc.max_concurrent_streams"
124
125 #define GRPC_ARG_MAX_MESSAGE_LENGTH "grpc.max_message_length"
126
127 #define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \
128 "grpc.http2.initial_sequence_number"
129
130 #define GRPC_ARG_DEFAULT_AUTHORITY "grpc.default_authority"
131
133 #define GRPC_ARG_PRIMARY_USER_AGENT_STRING "grpc.primary_user_agent"
134
136 #define GRPC_ARG_SECONDARY_USER_AGENT_STRING "grpc.secondary_user_agent"
137
139 typedef enum {
141 GRPC_CHANNEL_IDLE,
143 GRPC_CHANNEL_CONNECTING,
145 GRPC_CHANNEL_READY,
147 GRPC_CHANNEL_TRANSIENT_FAILURE,
149 GRPC_CHANNEL_FATAL_FAILURE
150 } grpc_connectivity_state;
151
156 typedef enum grpc_call_error {
158 GRPC_CALL_OK = 0,
160 GRPC_CALL_ERROR,
162 GRPC_CALL_ERROR_NOT_ON_SERVER,
164 GRPC_CALL_ERROR_NOT_ON_CLIENT,
166 GRPC_CALL_ERROR_ALREADY_ACCEPTED,
168 GRPC_CALL_ERROR_ALREADY_INVOKED,
170 GRPC_CALL_ERROR_NOT_INVOKED,
173 GRPC_CALL_ERROR_ALREADY_FINISHED,
175 GRPC_CALL_ERROR_TOO_MANY_OPERATIONS,
177 GRPC_CALL_ERROR_INVALID_FLAGS,
179 GRPC_CALL_ERROR_INVALID_METADATA,
182 GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE
183 } grpc_call_error;
184
185 /* Write Flags: */
189 #define GRPC_WRITE_BUFFER_HINT (0x00000001u)
190
192 #define GRPC_WRITE_NO_COMPRESS (0x00000002u)
193
194 #define GRPC_WRITE_USED_MASK (GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS)
195
197 typedef struct grpc_metadata {
198 const char *key;
199 const char *value;
200 size_t value_length;
201
206 struct {
207 void *obfuscated[3];
208 } internal_data;
209 } grpc_metadata;
210
212 typedef enum grpc_completion_type {
214 GRPC_QUEUE_SHUTDOWN,
216 GRPC_QUEUE_TIMEOUT,
218 GRPC_OP_COMPLETE
219 } grpc_completion_type;
220
224 typedef struct grpc_event {
226 grpc_completion_type type;
229 int success;
232 void *tag;
233 } grpc_event;
234
235 typedef struct {
236 size_t count;
237 size_t capacity;
238 grpc_metadata *metadata;
239 } grpc_metadata_array;
240
241 void grpc_metadata_array_init(grpc_metadata_array *array);
242 void grpc_metadata_array_destroy(grpc_metadata_array *array);
243
244 typedef struct {
245 char *method;
246 size_t method_capacity;
247 char *host;
248 size_t host_capacity;
249 gpr_timespec deadline;
250 } grpc_call_details;
251
252 void grpc_call_details_init(grpc_call_details *details);
253 void grpc_call_details_destroy(grpc_call_details *details);
254
255 typedef enum {
258 GRPC_OP_SEND_INITIAL_METADATA = 0,
260 GRPC_OP_SEND_MESSAGE,
264 GRPC_OP_SEND_CLOSE_FROM_CLIENT,
268 GRPC_OP_SEND_STATUS_FROM_SERVER,
271 GRPC_OP_RECV_INITIAL_METADATA,
274 GRPC_OP_RECV_MESSAGE,
279 GRPC_OP_RECV_STATUS_ON_CLIENT,
282 GRPC_OP_RECV_CLOSE_ON_SERVER
283 } grpc_op_type;
284
287 typedef struct grpc_op {
289 grpc_op_type op;
291 gpr_uint32 flags;
292 union {
293 struct {
294 size_t count;
295 grpc_metadata *metadata;
296 } send_initial_metadata;
297 grpc_byte_buffer *send_message;
298 struct {
299 size_t trailing_metadata_count;
300 grpc_metadata *trailing_metadata;
301 grpc_status_code status;
302 const char *status_details;
303 } send_status_from_server;
309 grpc_metadata_array *recv_initial_metadata;
313 grpc_byte_buffer **recv_message;
314 struct {
321 grpc_metadata_array *trailing_metadata;
322 grpc_status_code *status;
343 char **status_details;
344 size_t *status_details_capacity;
345 } recv_status_on_client;
346 struct {
349 int *cancelled;
350 } recv_close_on_server;
351 } data;
352 } grpc_op;
353
360 void grpc_init(void);
361
368 void grpc_shutdown(void);
369
371 const char *grpc_version_string(void);
372
374 grpc_completion_queue *grpc_completion_queue_create(void);
375
384 grpc_event grpc_completion_queue_next(grpc_completion_queue *cq,
385 gpr_timespec deadline);
386
395 grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, void *tag,
396 gpr_timespec deadline);
397
405 void grpc_completion_queue_shutdown(grpc_completion_queue *cq);
406
409 void grpc_completion_queue_destroy(grpc_completion_queue *cq);
410
412 grpc_connectivity_state grpc_channel_check_connectivity_state(
413 grpc_channel *channel, int try_to_connect);
414
420 void grpc_channel_watch_connectivity_state(
421 grpc_channel *channel, grpc_connectivity_state last_observed_state,
422 gpr_timespec deadline, grpc_completion_queue *cq, void *tag);
423
427 grpc_call *grpc_channel_create_call(grpc_channel *channel,
428 grpc_completion_queue *completion_queue,
429 const char *method, const char *host,
430 gpr_timespec deadline);
431
433 void *grpc_channel_register_call(grpc_channel *channel, const char *method,
434 const char *host);
435
437 grpc_call *grpc_channel_create_registered_call(
438 grpc_channel *channel, grpc_completion_queue *completion_queue,
439 void *registered_call_handle, gpr_timespec deadline);
440
452 grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops,
453 size_t nops, void *tag);
454
463 char *grpc_call_get_peer(grpc_call *call);
464
465 struct census_context;
466
467 /* Set census context for a call; Must be called before first call to
468 grpc_call_start_batch(). */
469 void grpc_census_call_set_context(grpc_call *call,
470 struct census_context *context);
471
472 /* Retrieve the calls current census context. */
473 struct census_context *grpc_census_call_get_context(grpc_call *call);
474
477 char *grpc_channel_get_target(grpc_channel *channel);
478
484 grpc_channel *grpc_insecure_channel_create(const char *target,
485 const grpc_channel_args *args);
486
488 grpc_channel *grpc_lame_client_channel_create(const char *target);
489
491 void grpc_channel_destroy(grpc_channel *channel);
492
493 /* Error handling for grpc_call
494 Most grpc_call functions return a grpc_error. If the error is not GRPC_OK
495 then the operation failed due to some unsatisfied precondition.
496 If a grpc_call fails, it's guaranteed that no change to the call state
497 has been made. */
498
504 grpc_call_error grpc_call_cancel(grpc_call *call);
505
512 grpc_call_error grpc_call_cancel_with_status(grpc_call *call,
513 grpc_status_code status,
514 const char *description);
515
518 void grpc_call_destroy(grpc_call *call);
519
523 grpc_call_error grpc_server_request_call(
524 grpc_server *server, grpc_call **call, grpc_call_details *details,
525 grpc_metadata_array *request_metadata,
526 grpc_completion_queue *cq_bound_to_call,
527 grpc_completion_queue *cq_for_notification, void *tag_new);
528
536 void *grpc_server_register_method(grpc_server *server, const char *method,
537 const char *host);
538
542 grpc_call_error grpc_server_request_registered_call(
543 grpc_server *server, void *registered_method, grpc_call **call,
544 gpr_timespec *deadline, grpc_metadata_array *request_metadata,
545 grpc_byte_buffer **optional_payload,
546 grpc_completion_queue *cq_bound_to_call,
547 grpc_completion_queue *cq_for_notification, void *tag_new);
548
553 grpc_server *grpc_server_create(const grpc_channel_args *args);
554
559 void grpc_server_register_completion_queue(grpc_server *server,
560 grpc_completion_queue *cq);
561
565 int grpc_server_add_http2_port(grpc_server *server, const char *addr);
566
568 void grpc_server_start(grpc_server *server);
569
577 void grpc_server_shutdown_and_notify(grpc_server *server,
578 grpc_completion_queue *cq, void *tag);
579
582 void grpc_server_cancel_all_calls(grpc_server *server);
583
588 void grpc_server_destroy(grpc_server *server);
589
598 int grpc_tracer_set_enabled(const char *name, int enabled);
599
600 #ifdef __cplusplus
601 }
602 #endif
603
604 #endif /* GRPC_GRPC_H */
GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE
completion queue for notification has not been registered with the server
Definition: grpc.h:182
GRPC_OP_COMPLETE
Operation completion.
Definition: grpc.h:218
grpc_event::tag
void * tag
The tag passed to grpc_call_start_batch etc to start this operation.
Definition: grpc.h:232
grpc_op::op
grpc_op_type op
Operation type, as defined by grpc_op_type.
Definition: grpc.h:289
grpc_connectivity_state
grpc_connectivity_state
Connectivity state of a channel.
Definition: grpc.h:139
value
const char * value
Definition: hpack_table.c:44
GRPC_OP_SEND_CLOSE_FROM_CLIENT
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:264
grpc_server_destroy
void grpc_server_destroy(grpc_server *server)
Destroy a server.
Definition: server.c:1063
grpc_op::status_details
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:343
grpc_op_type
grpc_op_type
Definition: grpc.h:255
grpc_op::flags
gpr_uint32 flags
Write flags bitset for grpc_begin_messages.
Definition: grpc.h:291
grpc_op
struct grpc_op grpc_op
Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT which has no arguments) ...
grpc_server_register_completion_queue
void grpc_server_register_completion_queue(grpc_server *server, grpc_completion_queue *cq)
Register a completion queue with the server.
Definition: server.c:742
grpc_op::recv_initial_metadata
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:309
grpc_completion_queue_pluck
grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, void *tag, gpr_timespec deadline)
Blocks until an event with tag 'tag' is available, the completion queue is being shutdown or deadline...
Definition: completion_queue.c:187
grpc_call_details_destroy
void grpc_call_details_destroy(grpc_call_details *details)
Definition: call_details.c:43
grpc_channel_args
An array of arguments that can be passed around.
Definition: grpc.h:113
grpc_channel
Definition: channel.c:61
grpc_channel_args::args
grpc_arg * args
Definition: grpc.h:115
byte_buffer.h
time.h
grpc_arg_type
grpc_arg_type
Type specifier for grpc_arg.
Definition: grpc.h:73
GRPC_CALL_ERROR_INVALID_FLAGS
the flags value was illegal for this call
Definition: grpc.h:177
grpc_op::status
grpc_status_code status
Definition: grpc.h:301
grpc_call_details::deadline
gpr_timespec deadline
Definition: grpc.h:249
GRPC_ARG_POINTER
Definition: grpc.h:76
grpc_event
The result of an operation.
Definition: grpc.h:224
grpc_lame_client_channel_create
grpc_channel * grpc_lame_client_channel_create(const char *target)
Create a lame client: this client fails every operation attempted on it.
Definition: lame_client.c:141
grpc_arg::integer
int integer
Definition: grpc.h:96
grpc_insecure_channel_create
grpc_channel * grpc_insecure_channel_create(const char *target, const grpc_channel_args *args)
Create a client channel to 'target'.
Definition: channel_create.c:157
GRPC_OP_SEND_STATUS_FROM_SERVER
Send status from the server: one and only one instance MUST be sent from the server unless the call w...
Definition: grpc.h:268
grpc_arg::string
char * string
Definition: grpc.h:95
grpc_call_details_init
void grpc_call_details_init(grpc_call_details *details)
Definition: call_details.c:39
grpc_call_details::host
char * host
Definition: grpc.h:247
grpc_event::success
int success
non-zero if the operation was successful, 0 upon failure.
Definition: grpc.h:229
grpc_call_destroy
void grpc_call_destroy(grpc_call *call)
Destroy a call.
Definition: call.c:1177
grpc_op::data
union grpc_op::@6 data
grpc_op::count
size_t count
Definition: grpc.h:294
grpc_arg
A single argument...
Definition: grpc.h:91
grpc_call_details
Definition: grpc.h:244
GRPC_CALL_ERROR
something failed, we don't know what
Definition: grpc.h:160
registered_method
Definition: server.c:169
grpc_byte_buffer
Definition: byte_buffer.h:49
grpc_op::recv_message
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:313
grpc_server_start
void grpc_server_start(grpc_server *server)
Start a server - tells all listeners to start listening.
Definition: server.c:845
grpc_metadata_array
Definition: grpc.h:235
gpr_uint32
uint32_t gpr_uint32
Definition: port_platform.h:309
grpc_arg::p
void * p
Definition: grpc.h:98
grpc_op::status_details_capacity
size_t * status_details_capacity
Definition: grpc.h:344
GRPC_OP_RECV_MESSAGE
Receive a message: 0 or more of these operations can occur for each call.
Definition: grpc.h:274
grpc_call_details::method_capacity
size_t method_capacity
Definition: grpc.h:246
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.
Definition: channel_connectivity.c:43
grpc_op::status
grpc_status_code * status
Definition: grpc.h:322
grpc_op::recv_status_on_client
struct grpc_op::@6::@9 recv_status_on_client
grpc_server_shutdown_and_notify
void grpc_server_shutdown_and_notify(grpc_server *server, grpc_completion_queue *cq, void *tag)
Begin shutting down a server.
Definition: server.c:989
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.
Definition: channel_connectivity.c:151
grpc_metadata_array::metadata
grpc_metadata * metadata
Definition: grpc.h:238
GRPC_CALL_ERROR_ALREADY_INVOKED
this method must be called before invoke
Definition: grpc.h:168
grpc_channel_register_call
void * grpc_channel_register_call(grpc_channel *channel, const char *method, const char *host)
Pre-register a method/host pair on a channel.
Definition: channel.c:181
GRPC_OP_SEND_INITIAL_METADATA
Send initial metadata: one and only one instance MUST be sent for each call, unless the call was canc...
Definition: grpc.h:258
GRPC_ARG_INTEGER
Definition: grpc.h:75
grpc_call_error
grpc_call_error
Result of a grpc call.
Definition: grpc.h:156
grpc_op::trailing_metadata
grpc_metadata * trailing_metadata
Definition: grpc.h:300
grpc_server_create
grpc_server * grpc_server_create(const grpc_channel_args *args)
Create a server.
Definition: server_create.c:39
grpc_metadata_array::capacity
size_t capacity
Definition: grpc.h:237
grpc_metadata::key
const char * key
Definition: grpc.h:198
grpc_server_cancel_all_calls
void grpc_server_cancel_all_calls(grpc_server *server)
Cancel all in-progress calls.
Definition: server.c:1053
GRPC_CALL_ERROR_INVALID_METADATA
invalid metadata was passed to this call
Definition: grpc.h:179
grpc_op::status_details
const char * status_details
Definition: grpc.h:302
grpc_call_cancel
grpc_call_error grpc_call_cancel(grpc_call *call)
Called by clients to cancel an RPC on the server.
Definition: call.c:1189
grpc_metadata
A single metadata element.
Definition: grpc.h:197
GRPC_CALL_ERROR_NOT_ON_SERVER
this method is not available on the server
Definition: grpc.h:162
GRPC_QUEUE_SHUTDOWN
Shutting down.
Definition: grpc.h:214
GRPC_OP_RECV_INITIAL_METADATA
Receive initial metadata: one and only one MUST be made on the client, must not be made on the server...
Definition: grpc.h:271
grpc_op
Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT which has no arguments) ...
Definition: grpc.h:287
grpc_server_request_call
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.
Definition: server.c:1148
grpc_metadata::obfuscated
void * obfuscated[3]
Definition: grpc.h:207
GRPC_OP_SEND_MESSAGE
Send a message: 0 or more of these operations can occur for each call.
Definition: grpc.h:260
GRPC_CALL_OK
everything went ok
Definition: grpc.h:158
grpc_completion_queue_next
grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, gpr_timespec deadline)
Blocks until an event is available, the completion queue is being shut down, or deadline is reached...
Definition: completion_queue.c:147
GRPC_CALL_ERROR_ALREADY_FINISHED
this call is already finished (writes_done or write_status has already been called) ...
Definition: grpc.h:173
grpc_event
struct grpc_event grpc_event
The result of an operation.
grpc_completion_type
grpc_completion_type
The type of completion (for grpc_event)
Definition: grpc.h:212
grpc_completion_queue
Definition: completion_queue.c:49
grpc_op::trailing_metadata_count
size_t trailing_metadata_count
Definition: grpc.h:299
grpc_call_details::host_capacity
size_t host_capacity
Definition: grpc.h:248
grpc_server_register_method
void * grpc_server_register_method(grpc_server *server, const char *method, const char *host)
Registers a method in the server.
Definition: server.c:820
grpc_channel_get_target
char * grpc_channel_get_target(grpc_channel *channel)
Return a newly allocated string representing the target a channel was created for.
Definition: channel.c:144
grpc_channel_destroy
void grpc_channel_destroy(grpc_channel *channel)
Close and destroy a grpc channel.
Definition: channel.c:257
grpc_op::send_initial_metadata
struct grpc_op::@6::@7 send_initial_metadata
grpc_version_string
const char * grpc_version_string(void)
Return a string representing the current version of grpc.
Definition: version.c:39
grpc_metadata::internal_data
struct grpc_metadata::@5 internal_data
The following fields are reserved for grpc internal use.
grpc_channel_args::num_args
size_t num_args
Definition: grpc.h:114
census_context
Definition: context.h:41
grpc_metadata_array::count
size_t count
Definition: grpc.h:236
GRPC_OP_RECV_STATUS_ON_CLIENT
Receive status on the client: one and only one must be made on the client.
Definition: grpc.h:279
GRPC_CHANNEL_READY
channel is ready for work
Definition: grpc.h:145
grpc_arg::key
char * key
Definition: grpc.h:93
grpc_server_add_http2_port
int grpc_server_add_http2_port(grpc_server *server, const char *addr)
Add a HTTP2 over plaintext over tcp listener.
Definition: server_chttp2.c:83
status.h
grpc_call_get_peer
char * grpc_call_get_peer(grpc_call *call)
Returns a newly allocated string representing the endpoint to which this call is communicating with...
Definition: call.c:1256
GRPC_CHANNEL_TRANSIENT_FAILURE
channel has seen a failure but expects to recover
Definition: grpc.h:147
grpc_metadata
struct grpc_metadata grpc_metadata
A single metadata element.
grpc_metadata::value
const char * value
Definition: grpc.h:199
slice.h
GRPC_CALL_ERROR_NOT_ON_CLIENT
this method is not available on the client
Definition: grpc.h:164
grpc_call_start_batch
grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops, size_t nops, void *tag)
Start a batch of operations defined in the array ops; when complete, post a completion of type 'tag' ...
Definition: call.c:1431
GRPC_CHANNEL_IDLE
channel is idle
Definition: grpc.h:141
GRPC_CHANNEL_FATAL_FAILURE
channel has seen a failure that it cannot recover from
Definition: grpc.h:149
grpc_op::recv_close_on_server
struct grpc_op::@6::@10 recv_close_on_server
gpr_timespec
Definition: time.h:60
grpc_status_code
grpc_status_code
Definition: status.h:41
grpc_channel_create_call
grpc_call * grpc_channel_create_call(grpc_channel *channel, grpc_completion_queue *completion_queue, const char *method, const char *host, gpr_timespec deadline)
Create a call given a grpc_channel, in order to call 'method'.
Definition: channel.c:165
grpc_census_call_get_context
struct census_context * grpc_census_call_get_context(grpc_call *call)
Definition: grpc_context.c:60
grpc_metadata_array_destroy
void grpc_metadata_array_destroy(grpc_metadata_array *array)
Definition: metadata_array.c:43
GRPC_QUEUE_TIMEOUT
No event before timeout.
Definition: grpc.h:216
grpc_init
void grpc_init(void)
Initialize the grpc library.
Definition: init.c:61
GRPC_CHANNEL_CONNECTING
channel is connecting
Definition: grpc.h:143
grpc_op::send_status_from_server
struct grpc_op::@6::@8 send_status_from_server
grpc_op::send_message
grpc_byte_buffer * send_message
Definition: grpc.h:297
grpc_op::trailing_metadata
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:321
grpc_server_request_registered_call
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.
Definition: server.c:1173
grpc_shutdown
void grpc_shutdown(void)
Shut down the grpc library.
Definition: init.c:94
grpc_metadata_array_init
void grpc_metadata_array_init(grpc_metadata_array *array)
Definition: metadata_array.c:39
grpc_completion_queue_destroy
void grpc_completion_queue_destroy(grpc_completion_queue *cq)
Destroy a completion queue.
Definition: completion_queue.c:255
grpc_channel_create_registered_call
grpc_call * grpc_channel_create_registered_call(grpc_channel *channel, grpc_completion_queue *completion_queue, void *registered_call_handle, gpr_timespec deadline)
Create a call given a handle returned from grpc_channel_register_call.
Definition: channel.c:197
grpc_metadata::value_length
size_t value_length
Definition: grpc.h:200
GRPC_CALL_ERROR_TOO_MANY_OPERATIONS
there is already an outstanding read/write operation on the call
Definition: grpc.h:175
GRPC_OP_RECV_CLOSE_ON_SERVER
Receive close on the server: one and only one must be made on the server.
Definition: grpc.h:282
grpc_event::type
grpc_completion_type type
The type of the completion.
Definition: grpc.h:226
GRPC_CALL_ERROR_ALREADY_ACCEPTED
this method must be called before server_accept
Definition: grpc.h:166
grpc_arg::type
grpc_arg_type type
Definition: grpc.h:92
grpc_completion_queue_shutdown
void grpc_completion_queue_shutdown(grpc_completion_queue *cq)
Begin destruction of a completion queue.
Definition: completion_queue.c:237
GRPC_ARG_STRING
Definition: grpc.h:74
grpc_op::metadata
grpc_metadata * metadata
Definition: grpc.h:295
grpc_call_cancel_with_status
grpc_call_error grpc_call_cancel_with_status(grpc_call *call, grpc_status_code status, const char *description)
Called by clients to cancel an RPC on the server.
Definition: call.c:1193
grpc_call
Definition: call.c:143
grpc_op::cancelled
int * cancelled
out argument, set to 1 if the call failed in any way (seen as a cancellation on the server)...
Definition: grpc.h:349
grpc_completion_queue_create
grpc_completion_queue * grpc_completion_queue_create(void)
Create a completion queue.
Definition: completion_queue.c:65
GRPC_CALL_ERROR_NOT_INVOKED
this method must be called after invoke
Definition: grpc.h:170
grpc_call_details::method
char * method
Definition: grpc.h:245
grpc_tracer_set_enabled
int grpc_tracer_set_enabled(const char *name, int enabled)
Enable or disable a tracer.
Definition: trace.c:112
grpc_server
Definition: server.c:181
grpc_census_call_set_context
void grpc_census_call_set_context(grpc_call *call, struct census_context *context)
Definition: grpc_context.c:42