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,
void grpc_transport_move_one_way_stats(grpc_transport_one_way_stats *from, grpc_transport_one_way_stats *to)
Definition: slice_internal.h:100
grpc_transport_stream_stats * collect_stats
Definition: transport.h:298
grpc_closure closure
Definition: transport.h:154
void grpc_transport_perform_op(grpc_transport *transport, grpc_transport_op *op)
struct grpc_transport_op::@23 send_ping
send a ping, if either on_initiate or on_ack is not NULL
void * cb_arg
Arguments to be passed to "cb".
Definition: closure.h:71
grpc_status_code
Definition: status.h:26
bool send_initial_metadata
Send initial metadata to the peer, from the provided metadata batch.
Definition: transport.h:189
bool enabled()
Definition: trace.h:80
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
Definition: connectivity_state.h:45
grpc_core::ConnectivityStateWatcherInterface * stop_connectivity_watch
Definition: transport.h:331
grpc_metadata_batch * send_trailing_metadata
Definition: transport.h:244
grpc_metadata_batch * recv_initial_metadata
Definition: transport.h:268
struct grpc_stream grpc_stream
Definition: transport.h:52
size_t grpc_transport_stream_size(grpc_transport *transport)
void grpc_stream_unref(grpc_stream_refcount *refcount, const char *reason)
Definition: transport.h:99
grpc_closure destroy
Definition: transport.h:58
Definition: transport.h:56
Definition: transport.h:220
void RefNonZero()
Definition: ref_counted.h:117
const char * object_type
Definition: transport.h:60
~grpc_transport_stream_op_batch_payload()
Definition: transport.h:224
Definition: call_combiner.h:49
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1]. ...
Definition: slice.h:60
Definition: error_internal.h:39
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_transport_one_way_stats incoming
Definition: transport.h:129
grpc_core::OrphanablePtr< grpc_core::ByteStream > send_message
Definition: transport.h:252
grpc_connectivity_state
Connectivity state of a channel.
Definition: connectivity_state.h:27
grpc_closure * recv_trailing_metadata_ready
Should be enqueued when trailing metadata is ready to be processed.
Definition: transport.h:300
grpc_connectivity_state start_connectivity_watch_state
Definition: transport.h:330
uint64_t framing_bytes
Definition: transport.h:123
grpc_core::DebugOnlyTraceFlag grpc_trace_stream_refcount
struct grpc_transport_op grpc_transport_op
Transport op: a set of operations to perform on a transport as a whole.
grpc_closure * on_ack
Called when the ping ack is received.
Definition: transport.h:359
std::unique_ptr< T, Deleter > OrphanablePtr
Definition: orphanable.h:68
void grpc_transport_perform_stream_op(grpc_transport *transport, grpc_stream *stream, grpc_transport_stream_op_batch *op)
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
void grpc_transport_destroy(grpc_transport *transport)
#define DEBUG_LOCATION
Definition: debug_location.h:41
void(* set_accept_stream_fn)(void *user_data, grpc_transport *transport, const void *server_data)
Definition: transport.h:346
Definition: ref_counted.h:62
grpc_slice_refcount slice_refcount
Definition: transport.h:62
Definition: transport.h:128
bool recv_message
Receive message data from the stream, into provided byte stream.
Definition: transport.h:201
Definition: polling_entity.h:37
grpc_transport_op * grpc_make_transport_op(grpc_closure *on_consumed)
void grpc_stream_ref(grpc_stream_refcount *refcount, const char *reason)
Definition: transport.h:82
grpc_core::OrphanablePtr< grpc_core::ConnectivityStateWatcherInterface > start_connectivity_watch
connectivity monitoring - set connectivity_state to NULL to unsubscribe
Definition: transport.h:329
char * grpc_transport_stream_op_batch_string(grpc_transport_stream_op_batch *op)
Definition: transport.h:163
grpc_pollset_set * bind_pollset_set
add this transport to a pollset_set
Definition: transport.h:352
gpr_atm * peer_string
Definition: transport.h:240
uint64_t data_bytes
Definition: transport.h:124
uint32_t * recv_flags
Definition: transport.h:272
bool send_message
Send message data to the peer, from the provided byte stream.
Definition: transport.h:195
void grpc_transport_ping(grpc_transport *transport, grpc_closure *cb)
struct grpc_transport_stream_op_batch_payload::@22 cancel_stream
Forcefully close this stream.
void grpc_transport_destroy_stream(grpc_transport *transport, grpc_stream *stream, grpc_closure *then_schedule_closure)
void * extra_arg
Definition: transport.h:153
grpc_closure * recv_message_ready
Should be enqueued when one message is ready to be processed.
Definition: transport.h:293
grpc_handler_private_op_data handler_private
Definition: transport.h:217
void * set_accept_stream_user_data
Definition: transport.h:348
grpc_error * cancel_error
Definition: transport.h:316
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
void grpc_stream_destroy(grpc_stream_refcount *refcount)
uint64_t header_bytes
Definition: transport.h:125
grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount *refcount, void *buffer, size_t length)
#define GPR_DEBUG
Macros to build log contexts at various severity levels.
Definition: log.h:55
grpc_call_context_element * context
Definition: transport.h:320
intptr_t gpr_atm
Definition: atm_gcc_atomic.h:30
int grpc_transport_init_stream(grpc_transport *transport, grpc_stream *stream, grpc_stream_refcount *refcount, const void *server_data, grpc_core::Arena *arena)
bool cancel_stream
Cancel this stream with the provided error.
Definition: transport.h:208
grpc_pollset * bind_pollset
add this transport to a pollset
Definition: transport.h:350
void grpc_transport_set_pops(grpc_transport *transport, grpc_stream *stream, grpc_polling_entity *pollent)
grpc_handler_private_op_data handler_private
Definition: transport.h:368
struct grpc_pollset_set grpc_pollset_set
Definition: pollset_set.h:31
grpc_closure * recv_initial_metadata_ready
Should be enqueued when initial metadata is ready to be processed.
Definition: transport.h:274
bool Unref()
Definition: ref_counted.h:174
grpc_transport_stream_op_batch * grpc_make_transport_stream_op(grpc_closure *on_consumed)
grpc_transport_stream_op_batch_payload(grpc_call_context_element *context)
Definition: transport.h:221
Definition: transport.h:122
struct grpc_pollset grpc_pollset
Definition: pollset.h:38
A closure over a grpc_iomgr_cb_func.
Definition: closure.h:56
#define GRPC_ERROR_NONE
The following "special" errors can be propagated without allocating memory.
Definition: error.h:125
struct grpc_stream_refcount grpc_stream_refcount
channel is idle
Definition: connectivity_state.h:29
grpc_handler_private_op_data()
Definition: transport.h:155
bool reset_connect_backoff
Definition: transport.h:362
bool stream_write_closed
Definition: transport.h:264
char * grpc_transport_op_string(grpc_transport_op *op)
grpc_core::RefCount refs
Definition: transport.h:57
bool is_traced
Is this stream traced.
Definition: transport.h:211
grpc_endpoint * grpc_transport_get_endpoint(grpc_transport *transport)
grpc_transport_stream_op_batch_payload * payload
Values for the stream op (fields set are determined by flags above)
Definition: transport.h:186
Definition: endpoint.h:102
bool recv_initial_metadata
Receive initial metadata from the stream, into provided metadata batch.
Definition: transport.h:198
grpc_metadata_batch * send_initial_metadata
Definition: transport.h:231
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
void grpc_transport_goaway(grpc_transport *transport, grpc_status_code status, grpc_slice debug_data)
void(* grpc_iomgr_cb_func)(void *arg, grpc_error *error)
gRPC Callback definition.
Definition: closure.h:53
grpc_metadata_batch * recv_trailing_metadata
Definition: transport.h:297
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::OrphanablePtr< grpc_core::ByteStream > * recv_message
Definition: transport.h:291
Definition: transport_impl.h:66
Definition: transport.h:152
void grpc_transport_move_stats(grpc_transport_stream_stats *from, grpc_transport_stream_stats *to)
grpc_transport_one_way_stats outgoing
Definition: transport.h:130
bool send_trailing_metadata
Send trailing metadata to the peer, from the provided metadata batch.
Definition: transport.h:192
Transport op: a set of operations to perform on a transport as a whole.
Definition: transport.h:324
void grpc_transport_stream_op_batch_finish_with_failure(grpc_transport_stream_op_batch *op, grpc_error *error, grpc_core::CallCombiner *call_combiner)
grpc_transport_stream_op_batch()
Definition: transport.h:164
grpc_closure * on_consumed
Called when processing of this op is done.
Definition: transport.h:326
void grpc_stream_ref_init(grpc_stream_refcount *refcount, int initial_refs, grpc_iomgr_cb_func cb, void *cb_arg, const char *object_type)
bool * trailing_metadata_available
Definition: transport.h:278
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