19 #ifndef GRPC_CORE_LIB_TRANSPORT_TRANSPORT_H
20 #define GRPC_CORE_LIB_TRANSPORT_TRANSPORT_H
40 #define GRPC_PROTOCOL_VERSION_MAX_MAJOR 2
41 #define GRPC_PROTOCOL_VERSION_MAX_MINOR 1
42 #define GRPC_PROTOCOL_VERSION_MIN_MAJOR 2
43 #define GRPC_PROTOCOL_VERSION_MIN_MINOR 1
68 const char* object_type);
69 #define GRPC_STREAM_REF_INIT(rc, ir, cb, cb_arg, objtype) \
70 grpc_stream_ref_init(rc, ir, cb, cb_arg, objtype)
74 #define GRPC_STREAM_REF_INIT(rc, ir, cb, cb_arg, objtype) \
76 grpc_stream_ref_init(rc, ir, cb, cb_arg); \
100 const char* reason) {
120 void* buffer,
size_t length);
347 const void* server_data) =
nullptr;
387 const void* server_data,
Definition: call_combiner.h:49
Definition: connectivity_state.h:46
Definition: ref_counted.h:62
void RefNonZero()
Definition: ref_counted.h:117
bool Unref()
Definition: ref_counted.h:174
bool enabled()
Definition: trace.h:80
void(* grpc_iomgr_cb_func)(void *arg, grpc_error *error)
gRPC Callback definition.
Definition: closure.h:53
#define DEBUG_LOCATION
Definition: debug_location.h:41
#define GRPC_ERROR_NONE
The following "special" errors can be propagated without allocating memory.
Definition: error.h:125
grpc_status_code
Definition: status.h:26
intptr_t gpr_atm
Definition: atm_gcc_atomic.h:30
#define GPR_DEBUG
Macros to build log contexts at various severity levels.
Definition: log.h:55
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
Log a message.
grpc_connectivity_state
Connectivity state of a channel.
Definition: connectivity_state.h:27
@ GRPC_CHANNEL_IDLE
channel is idle
Definition: connectivity_state.h:29
std::unique_ptr< T, Deleter > OrphanablePtr
Definition: orphanable.h:68
struct grpc_pollset grpc_pollset
Definition: pollset.h:38
struct grpc_pollset_set grpc_pollset_set
Definition: pollset_set.h:31
A closure over a grpc_iomgr_cb_func.
Definition: closure.h:56
void * cb_arg
Arguments to be passed to "cb".
Definition: closure.h:71
Definition: endpoint.h:102
Definition: error_internal.h:39
Definition: transport.h:152
grpc_closure closure
Definition: transport.h:154
grpc_handler_private_op_data()
Definition: transport.h:155
void * extra_arg
Definition: transport.h:153
Definition: polling_entity.h:37
Definition: slice_internal.h:100
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1].
Definition: slice.h:60
Definition: transport.h:56
grpc_closure destroy
Definition: transport.h:58
grpc_slice_refcount slice_refcount
Definition: transport.h:62
grpc_core::RefCount refs
Definition: transport.h:57
const char * object_type
Definition: transport.h:60
Definition: transport.h:122
uint64_t header_bytes
Definition: transport.h:125
uint64_t data_bytes
Definition: transport.h:124
uint64_t framing_bytes
Definition: transport.h:123
Transport op: a set of operations to perform on a transport as a whole.
Definition: transport.h:324
grpc_closure * on_initiate
Ping may be delayed by the transport, on_initiate callback will be called when the ping is actually b...
Definition: transport.h:357
bool reset_connect_backoff
Definition: transport.h:362
grpc_closure * on_consumed
Called when processing of this op is done.
Definition: transport.h:326
grpc_connectivity_state start_connectivity_watch_state
Definition: transport.h:330
grpc_core::OrphanablePtr< grpc_core::ConnectivityStateWatcherInterface > start_connectivity_watch
connectivity monitoring - set connectivity_state to NULL to unsubscribe
Definition: transport.h:329
void * set_accept_stream_user_data
Definition: transport.h:348
grpc_error * disconnect_with_error
should the transport be disconnected Error contract: the transport that gets this op must cause disco...
Definition: transport.h:336
grpc_pollset_set * bind_pollset_set
add this transport to a pollset_set
Definition: transport.h:352
struct grpc_transport_op::@23 send_ping
send a ping, if either on_initiate or on_ack is not NULL
grpc_closure * on_ack
Called when the ping ack is received.
Definition: transport.h:359
grpc_error * goaway_error
what should the goaway contain? Error contract: the transport that gets this op must cause goaway_err...
Definition: transport.h:340
grpc_handler_private_op_data handler_private
Definition: transport.h:368
void(* set_accept_stream_fn)(void *user_data, grpc_transport *transport, const void *server_data)
Definition: transport.h:346
bool set_accept_stream
set the callback for accepting new streams; this is a permanent callback, unlike the other one-shot c...
Definition: transport.h:345
grpc_core::ConnectivityStateWatcherInterface * stop_connectivity_watch
Definition: transport.h:331
grpc_pollset * bind_pollset
add this transport to a pollset
Definition: transport.h:350
Definition: transport.h:220
grpc_metadata_batch * recv_initial_metadata
Definition: transport.h:268
uint32_t * recv_flags
Definition: transport.h:272
bool * trailing_metadata_available
Definition: transport.h:278
~grpc_transport_stream_op_batch_payload()
Definition: transport.h:224
grpc_core::OrphanablePtr< grpc_core::ByteStream > send_message
Definition: transport.h:252
grpc_transport_stream_stats * collect_stats
Definition: transport.h:298
grpc_metadata_batch * send_trailing_metadata
Definition: transport.h:244
grpc_closure * recv_message_ready
Should be enqueued when one message is ready to be processed.
Definition: transport.h:293
grpc_transport_stream_op_batch_payload(grpc_call_context_element *context)
Definition: transport.h:221
struct grpc_transport_stream_op_batch_payload::@22 cancel_stream
Forcefully close this stream.
grpc_error * cancel_error
Definition: transport.h:316
grpc_closure * recv_initial_metadata_ready
Should be enqueued when initial metadata is ready to be processed.
Definition: transport.h:274
gpr_atm * peer_string
Definition: transport.h:240
grpc_core::OrphanablePtr< grpc_core::ByteStream > * recv_message
Definition: transport.h:291
grpc_metadata_batch * recv_trailing_metadata
Definition: transport.h:297
grpc_metadata_batch * send_initial_metadata
Definition: transport.h:231
grpc_closure * recv_trailing_metadata_ready
Should be enqueued when trailing metadata is ready to be processed.
Definition: transport.h:300
uint32_t send_initial_metadata_flags
Iff send_initial_metadata != NULL, flags associated with send_initial_metadata: a bitfield of GRPC_IN...
Definition: transport.h:234
bool stream_write_closed
Definition: transport.h:264
grpc_call_context_element * context
Definition: transport.h:320
Definition: transport.h:163
grpc_transport_stream_op_batch()
Definition: transport.h:164
bool is_traced
Is this stream traced.
Definition: transport.h:211
grpc_transport_stream_op_batch_payload * payload
Values for the stream op (fields set are determined by flags above)
Definition: transport.h:186
bool recv_message
Receive message data from the stream, into provided byte stream.
Definition: transport.h:201
bool cancel_stream
Cancel this stream with the provided error.
Definition: transport.h:208
grpc_handler_private_op_data handler_private
Definition: transport.h:217
bool recv_trailing_metadata
Receive trailing metadata from the stream, into provided metadata batch.
Definition: transport.h:205
grpc_closure * on_complete
Should be scheduled when all of the non-recv operations in the batch are complete.
Definition: transport.h:183
bool send_trailing_metadata
Send trailing metadata to the peer, from the provided metadata batch.
Definition: transport.h:192
bool send_message
Send message data to the peer, from the provided byte stream.
Definition: transport.h:195
bool send_initial_metadata
Send initial metadata to the peer, from the provided metadata batch.
Definition: transport.h:189
bool recv_initial_metadata
Receive initial metadata from the stream, into provided metadata batch.
Definition: transport.h:198
Definition: transport.h:128
grpc_transport_one_way_stats outgoing
Definition: transport.h:130
grpc_transport_one_way_stats incoming
Definition: transport.h:129
Definition: transport_impl.h:66
grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount *refcount, void *buffer, size_t length)
void grpc_transport_perform_stream_op(grpc_transport *transport, grpc_stream *stream, grpc_transport_stream_op_batch *op)
char * grpc_transport_op_string(grpc_transport_op *op)
grpc_transport_op * grpc_make_transport_op(grpc_closure *on_consumed)
grpc_transport_stream_op_batch * grpc_make_transport_stream_op(grpc_closure *on_consumed)
void grpc_stream_ref_init(grpc_stream_refcount *refcount, int initial_refs, grpc_iomgr_cb_func cb, void *cb_arg, const char *object_type)
void grpc_stream_ref(grpc_stream_refcount *refcount, const char *reason)
Definition: transport.h:82
void grpc_transport_move_one_way_stats(grpc_transport_one_way_stats *from, grpc_transport_one_way_stats *to)
char * grpc_transport_stream_op_batch_string(grpc_transport_stream_op_batch *op)
size_t grpc_transport_stream_size(grpc_transport *transport)
grpc_core::DebugOnlyTraceFlag grpc_trace_stream_refcount
void grpc_stream_unref(grpc_stream_refcount *refcount, const char *reason)
Definition: transport.h:99
struct grpc_stream grpc_stream
Definition: transport.h:52
void grpc_transport_goaway(grpc_transport *transport, grpc_status_code status, grpc_slice debug_data)
void grpc_transport_move_stats(grpc_transport_stream_stats *from, grpc_transport_stream_stats *to)
void grpc_transport_set_pops(grpc_transport *transport, grpc_stream *stream, grpc_polling_entity *pollent)
void grpc_transport_ping(grpc_transport *transport, grpc_closure *cb)
struct grpc_stream_refcount grpc_stream_refcount
void grpc_stream_destroy(grpc_stream_refcount *refcount)
grpc_endpoint * grpc_transport_get_endpoint(grpc_transport *transport)
void grpc_transport_destroy_stream(grpc_transport *transport, grpc_stream *stream, grpc_closure *then_schedule_closure)
int grpc_transport_init_stream(grpc_transport *transport, grpc_stream *stream, grpc_stream_refcount *refcount, const void *server_data, grpc_core::Arena *arena)
void grpc_transport_destroy(grpc_transport *transport)
void grpc_transport_stream_op_batch_finish_with_failure(grpc_transport_stream_op_batch *op, grpc_error *error, grpc_core::CallCombiner *call_combiner)
void grpc_transport_perform_op(grpc_transport *transport, grpc_transport_op *op)
struct grpc_transport_op grpc_transport_op
Transport op: a set of operations to perform on a transport as a whole.