34 #ifndef GRPCXX_CHANNEL_H
35 #define GRPCXX_CHANNEL_H
39 #include <grpc/grpc.h>
51 class SecureCredentials;
57 template <
class R,
class W>
63 template <
class R,
class W>
71 public std::enable_shared_from_this<Channel> {
77 grpc_connectivity_state
GetState(
bool try_to_connect);
85 NotifyOnStateChangeImpl(last_observed, deadline_tp.
raw_time(), cq, tag);
93 return WaitForStateChangeImpl(last_observed, deadline_tp.
raw_time());
98 friend class ::grpc::ClientReader;
100 friend class ::grpc::ClientWriter;
101 template <
class R,
class W>
102 friend class ::grpc::ClientReaderWriter;
104 friend class ::grpc::ClientAsyncReader;
106 friend class ::grpc::ClientAsyncWriter;
107 template <
class R,
class W>
108 friend class ::grpc::ClientAsyncReaderWriter;
110 friend class ::grpc::ClientAsyncResponseReader;
111 template <
class InputMessage,
class OutputMessage>
114 const InputMessage& request,
115 OutputMessage* result);
116 friend class ::grpc::RpcMethod;
125 void* RegisterMethod(
const char* method);
127 void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
130 bool WaitForStateChangeImpl(grpc_connectivity_state last_observed,
131 gpr_timespec deadline);
134 grpc_channel*
const c_channel_;
139 #endif // GRPCXX_CHANNEL_H
void NotifyOnStateChange(grpc_connectivity_state last_observed, T deadline, CompletionQueue *cq, void *tag)
Return the tag on cq when the channel state is changed or deadline expires.
Definition: channel.h:82
bool WaitForStateChange(grpc_connectivity_state last_observed, T deadline)
Blocking wait for channel state change or deadline expiration.
Definition: channel.h:91
std::string string
Definition: config.h:112
An abstract collection of call ops, used to generate the grpc_call_op structure to pass down to the l...
Definition: call.h:478
Options for channel creation.
Definition: channel_arguments.h:52
grpc_connectivity_state GetState(bool try_to_connect)
Get the current channel state.
#define GRPC_FINAL
Definition: config.h:71
gpr_timespec raw_time()
Definition: time.h:56
Definition: client_context.h:149
Definition: grpc_library.h:41
friend std::shared_ptr< Channel > CreateChannelInternal(const grpc::string &host, grpc_channel *c_channel)
A credentials object encapsulates all the state needed by a client to authenticate with a server and ...
Definition: credentials.h:53
friend Status BlockingUnaryCall(Channel *channel, const RpcMethod &method, ClientContext *context, const InputMessage &request, OutputMessage *result)
Definition: client_unary_call.h:50
A thin wrapper around grpc_completion_queue (see / src/core/surface/completion_queue.h).
Definition: completion_queue.h:81
Definition: rpc_method.h:43
Did it work? If it didn't, why?
Definition: status.h:45
Channels represent a connection to an endpoint. Created by CreateChannel.
Definition: channel.h:69