|
@@ -91,6 +91,22 @@ typedef enum grpc_completion_type {
|
|
|
GRPC_OP_COMPLETE
|
|
GRPC_OP_COMPLETE
|
|
|
} grpc_completion_type;
|
|
} grpc_completion_type;
|
|
|
|
|
|
|
|
|
|
+/** Connectivity state of a channel. */
|
|
|
|
|
+typedef enum grpc_connectivity_state {
|
|
|
|
|
+ /** channel has just been initialized */
|
|
|
|
|
+ GRPC_CHANNEL_INIT = -1,
|
|
|
|
|
+ /** channel is idle */
|
|
|
|
|
+ GRPC_CHANNEL_IDLE,
|
|
|
|
|
+ /** channel is connecting */
|
|
|
|
|
+ GRPC_CHANNEL_CONNECTING,
|
|
|
|
|
+ /** channel is ready for work */
|
|
|
|
|
+ GRPC_CHANNEL_READY,
|
|
|
|
|
+ /** channel has seen a failure but expects to recover */
|
|
|
|
|
+ GRPC_CHANNEL_TRANSIENT_FAILURE,
|
|
|
|
|
+ /** channel has seen a failure that it cannot recover from */
|
|
|
|
|
+ GRPC_CHANNEL_SHUTDOWN
|
|
|
|
|
+} grpc_connectivity_state;
|
|
|
|
|
+
|
|
|
typedef struct grpc_event {
|
|
typedef struct grpc_event {
|
|
|
/** The type of the completion. */
|
|
/** The type of the completion. */
|
|
|
grpc_completion_type type;
|
|
grpc_completion_type type;
|
|
@@ -129,6 +145,9 @@ cgrpc_call *cgrpc_channel_create_call(cgrpc_channel *channel,
|
|
|
double timeout);
|
|
double timeout);
|
|
|
cgrpc_completion_queue *cgrpc_channel_completion_queue(cgrpc_channel *channel);
|
|
cgrpc_completion_queue *cgrpc_channel_completion_queue(cgrpc_channel *channel);
|
|
|
|
|
|
|
|
|
|
+grpc_connectivity_state cgrpc_channel_check_connectivity_state(
|
|
|
|
|
+ cgrpc_channel *channel, int try_to_connect);
|
|
|
|
|
+
|
|
|
// server support
|
|
// server support
|
|
|
cgrpc_server *cgrpc_server_create(const char *address);
|
|
cgrpc_server *cgrpc_server_create(const char *address);
|
|
|
cgrpc_server *cgrpc_server_create_secure(const char *address,
|
|
cgrpc_server *cgrpc_server_create_secure(const char *address,
|