GRPC C++  1.0.0
Data Structures | Macros | Typedefs | Enumerations
grpc_types.h File Reference
#include <grpc/impl/codegen/byte_buffer.h>
#include <grpc/impl/codegen/status.h>
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  grpc_arg_pointer_vtable
 
struct  grpc_arg
 A single argument... More...
 
struct  grpc_channel_args
 An array of arguments that can be passed around. More...
 
struct  grpc_metadata
 A single metadata element. More...
 
struct  grpc_event
 The result of an operation. More...
 
struct  grpc_metadata_array
 
struct  grpc_call_details
 
struct  grpc_op
 Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT which has no arguments) More...
 

Macros

#define GRPC_ARG_ENABLE_CENSUS   "grpc.census"
 If non-zero, enable census for tracing and stats collection. More...
 
#define GRPC_ARG_ENABLE_LOAD_REPORTING   "grpc.loadreporting"
 If non-zero, enable load reporting. More...
 
#define GRPC_ARG_MAX_CONCURRENT_STREAMS   "grpc.max_concurrent_streams"
 Maximum number of concurrent incoming streams to allow on a http2 connection. More...
 
#define GRPC_ARG_MAX_MESSAGE_LENGTH   "grpc.max_message_length"
 Maximum message length that the channel can receive. More...
 
#define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER   "grpc.http2.initial_sequence_number"
 Initial sequence number for http2 transports. More...
 
#define GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES   "grpc.http2.lookahead_bytes"
 Amount to read ahead on individual streams. More...
 
#define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER   "grpc.http2.hpack_table_size.decoder"
 How much memory to use for hpack decoding. More...
 
#define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER   "grpc.http2.hpack_table_size.encoder"
 How much memory to use for hpack encoding. More...
 
#define GRPC_ARG_DEFAULT_AUTHORITY   "grpc.default_authority"
 Default authority to pass if none specified on call construction. More...
 
#define GRPC_ARG_PRIMARY_USER_AGENT_STRING   "grpc.primary_user_agent"
 Primary user agent: goes at the start of the user-agent metadata sent on each request. More...
 
#define GRPC_ARG_SECONDARY_USER_AGENT_STRING   "grpc.secondary_user_agent"
 Secondary user agent: goes at the end of the user-agent metadata sent on each request. More...
 
#define GRPC_ARG_MAX_RECONNECT_BACKOFF_MS   "grpc.max_reconnect_backoff_ms"
 The maximum time between subsequent connection attempts, in ms. More...
 
#define GRPC_SSL_TARGET_NAME_OVERRIDE_ARG   "grpc.ssl_target_name_override"
 
#define GRPC_ARG_MAX_METADATA_SIZE   "grpc.max_metadata_size"
 
#define GRPC_ARG_ALLOW_REUSEPORT   "grpc.so_reuseport"
 If non-zero, allow the use of SO_REUSEPORT if it's available (default 1) More...
 
#define GRPC_WRITE_BUFFER_HINT   (0x00000001u)
 Hint that the write may be buffered and need not go out on the wire immediately. More...
 
#define GRPC_WRITE_NO_COMPRESS   (0x00000002u)
 Force compression to be disabled for a particular write (start_write/add_metadata). More...
 
#define GRPC_WRITE_USED_MASK   (GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS)
 Mask of all valid flags. More...
 
#define GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST   (0x00000010u)
 Signal that the call is idempotent. More...
 
#define GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY   (0x00000020u)
 Signal that the call should not return UNAVAILABLE before it has started. More...
 
#define GRPC_INITIAL_METADATA_USED_MASK
 Mask of all valid flags. More...
 

Typedefs

typedef struct grpc_completion_queue grpc_completion_queue
 Completion Queues enable notification of the completion of asynchronous actions. More...
 
typedef struct grpc_alarm grpc_alarm
 An alarm associated with a completion queue. More...
 
typedef struct grpc_channel grpc_channel
 The Channel interface allows creation of Call objects. More...
 
typedef struct grpc_server grpc_server
 A server listens to some port and responds to request calls. More...
 
typedef struct grpc_call grpc_call
 A Call represents an RPC. More...
 
typedef struct grpc_arg_pointer_vtable grpc_arg_pointer_vtable
 
typedef enum grpc_call_error grpc_call_error
 Result of a grpc call. More...
 
typedef struct grpc_metadata grpc_metadata
 A single metadata element. More...
 
typedef enum grpc_completion_type grpc_completion_type
 The type of completion (for grpc_event) More...
 
typedef struct grpc_event grpc_event
 The result of an operation. More...
 
typedef struct grpc_op grpc_op
 Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT which has no arguments) More...
 

Enumerations

enum  grpc_arg_type { GRPC_ARG_STRING, GRPC_ARG_INTEGER, GRPC_ARG_POINTER }
 Type specifier for grpc_arg. More...
 
enum  grpc_call_error {
  GRPC_CALL_OK = 0, GRPC_CALL_ERROR, GRPC_CALL_ERROR_NOT_ON_SERVER, GRPC_CALL_ERROR_NOT_ON_CLIENT,
  GRPC_CALL_ERROR_ALREADY_ACCEPTED, GRPC_CALL_ERROR_ALREADY_INVOKED, GRPC_CALL_ERROR_NOT_INVOKED, GRPC_CALL_ERROR_ALREADY_FINISHED,
  GRPC_CALL_ERROR_TOO_MANY_OPERATIONS, GRPC_CALL_ERROR_INVALID_FLAGS, GRPC_CALL_ERROR_INVALID_METADATA, GRPC_CALL_ERROR_INVALID_MESSAGE,
  GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE, GRPC_CALL_ERROR_BATCH_TOO_BIG, GRPC_CALL_ERROR_PAYLOAD_TYPE_MISMATCH
}
 Result of a grpc call. More...
 
enum  grpc_completion_type { GRPC_QUEUE_SHUTDOWN, GRPC_QUEUE_TIMEOUT, GRPC_OP_COMPLETE }
 The type of completion (for grpc_event) More...
 
enum  grpc_op_type {
  GRPC_OP_SEND_INITIAL_METADATA = 0, GRPC_OP_SEND_MESSAGE, GRPC_OP_SEND_CLOSE_FROM_CLIENT, GRPC_OP_SEND_STATUS_FROM_SERVER,
  GRPC_OP_RECV_INITIAL_METADATA, GRPC_OP_RECV_MESSAGE, GRPC_OP_RECV_STATUS_ON_CLIENT, GRPC_OP_RECV_CLOSE_ON_SERVER
}
 

Macro Definition Documentation

#define GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST   (0x00000010u)

Signal that the call is idempotent.

#define GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY   (0x00000020u)

Signal that the call should not return UNAVAILABLE before it has started.

#define GRPC_INITIAL_METADATA_USED_MASK
Value:
#define GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY
Signal that the call should not return UNAVAILABLE before it has started.
Definition: grpc_types.h:224
#define GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST
Signal that the call is idempotent.
Definition: grpc_types.h:222

Mask of all valid flags.

#define GRPC_WRITE_BUFFER_HINT   (0x00000001u)

Hint that the write may be buffered and need not go out on the wire immediately.

GRPC is free to buffer the message until the next non-buffered write, or until writes_done, but it need not buffer completely or at all.

#define GRPC_WRITE_NO_COMPRESS   (0x00000002u)

Force compression to be disabled for a particular write (start_write/add_metadata).

Illegal on invoke/accept.

#define GRPC_WRITE_USED_MASK   (GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS)

Mask of all valid flags.

Typedef Documentation

typedef struct grpc_alarm grpc_alarm

An alarm associated with a completion queue.

typedef struct grpc_call grpc_call

A Call represents an RPC.

When created, it is in a configuration state allowing properties to be set until it is invoked. After invoke, the Call can have messages written to it and read from it.

Result of a grpc call.

If the caller satisfies the prerequisites of a particular operation, the grpc_call_error returned will be GRPC_CALL_OK. Receiving any other value listed here is an indication of a bug in the caller.

typedef struct grpc_channel grpc_channel

The Channel interface allows creation of Call objects.

Completion Queues enable notification of the completion of asynchronous actions.

The type of completion (for grpc_event)

typedef struct grpc_event grpc_event

The result of an operation.

Returned by a completion queue when the operation started with tag.

typedef struct grpc_metadata grpc_metadata

A single metadata element.

typedef struct grpc_op grpc_op

Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT which has no arguments)

typedef struct grpc_server grpc_server

A server listens to some port and responds to request calls.

Enumeration Type Documentation

Type specifier for grpc_arg.

Enumerator
GRPC_ARG_STRING 
GRPC_ARG_INTEGER 
GRPC_ARG_POINTER 

Result of a grpc call.

If the caller satisfies the prerequisites of a particular operation, the grpc_call_error returned will be GRPC_CALL_OK. Receiving any other value listed here is an indication of a bug in the caller.

Enumerator
GRPC_CALL_OK 

everything went ok

GRPC_CALL_ERROR 

something failed, we don't know what

GRPC_CALL_ERROR_NOT_ON_SERVER 

this method is not available on the server

GRPC_CALL_ERROR_NOT_ON_CLIENT 

this method is not available on the client

GRPC_CALL_ERROR_ALREADY_ACCEPTED 

this method must be called before server_accept

GRPC_CALL_ERROR_ALREADY_INVOKED 

this method must be called before invoke

GRPC_CALL_ERROR_NOT_INVOKED 

this method must be called after invoke

GRPC_CALL_ERROR_ALREADY_FINISHED 

this call is already finished (writes_done or write_status has already been called)

GRPC_CALL_ERROR_TOO_MANY_OPERATIONS 

there is already an outstanding read/write operation on the call

GRPC_CALL_ERROR_INVALID_FLAGS 

the flags value was illegal for this call

GRPC_CALL_ERROR_INVALID_METADATA 

invalid metadata was passed to this call

GRPC_CALL_ERROR_INVALID_MESSAGE 

invalid message was passed to this call

GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE 

completion queue for notification has not been registered with the server

GRPC_CALL_ERROR_BATCH_TOO_BIG 

this batch of operations leads to more operations than allowed

GRPC_CALL_ERROR_PAYLOAD_TYPE_MISMATCH 

payload type requested is not the type registered

The type of completion (for grpc_event)

Enumerator
GRPC_QUEUE_SHUTDOWN 

Shutting down.

GRPC_QUEUE_TIMEOUT 

No event before timeout.

GRPC_OP_COMPLETE 

Operation completion.

Enumerator
GRPC_OP_SEND_INITIAL_METADATA 

Send initial metadata: one and only one instance MUST be sent for each call, unless the call was cancelled - in which case this can be skipped.

This op completes after all bytes of metadata have been accepted by outgoing flow control.

GRPC_OP_SEND_MESSAGE 

Send a message: 0 or more of these operations can occur for each call.

This op completes after all bytes for the message have been accepted by outgoing flow control.

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.

This op completes after all bytes for the call (including the close) have passed outgoing flow control.

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 was cancelled - in which case this can be skipped.

This op completes after all bytes for the call (including the status) have passed outgoing flow control.

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.

This op completes after all initial metadata has been read from the peer.

GRPC_OP_RECV_MESSAGE 

Receive a message: 0 or more of these operations can occur for each call.

This op completes after all bytes of the received message have been read, or after a half-close has been received on this call.

GRPC_OP_RECV_STATUS_ON_CLIENT 

Receive status on the client: one and only one must be made on the client.

This operation always succeeds, meaning ops paired with this operation will also appear to succeed, even though they may not have. In that case the status will indicate some failure. This op completes after all activity on the call has completed.

GRPC_OP_RECV_CLOSE_ON_SERVER 

Receive close on the server: one and only one must be made on the server.

This op completes after the close has been received by the server. This operation always succeeds, meaning ops paired with this operation will also appear to succeed, even though they may not have.