3 * Copyright 2015 gRPC authors.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
20 #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
22 #include <grpc/support/port_platform.h>
24 #include "src/core/ext/filters/client_channel/client_channel_channelz.h"
25 #include "src/core/ext/filters/client_channel/client_channel_factory.h"
26 #include "src/core/ext/filters/client_channel/resolver.h"
27 #include "src/core/lib/channel/channel_stack.h"
29 extern grpc_core::TraceFlag grpc_client_channel_trace;
31 // Channel arg key for server URI string.
32 #define GRPC_ARG_SERVER_URI "grpc.server_uri"
34 /* A client channel is a channel that begins disconnected, and can connect
35 to some endpoint on demand. If that endpoint disconnects, it will be
36 connected to again later.
38 Calls on a disconnected client channel are queued until a connection is
41 extern const grpc_channel_filter grpc_client_channel_filter;
43 grpc_connectivity_state grpc_client_channel_check_connectivity_state(
44 grpc_channel_element* elem, int try_to_connect);
46 int grpc_client_channel_num_external_connectivity_watchers(
47 grpc_channel_element* elem);
49 void grpc_client_channel_watch_connectivity_state(
50 grpc_channel_element* elem, grpc_polling_entity pollent,
51 grpc_connectivity_state* state, grpc_closure* on_complete,
52 grpc_closure* watcher_timer_init);
54 /* Debug helper: pull the subchannel call from a call stack element */
55 grpc_core::RefCountedPtr<grpc_core::SubchannelCall>
56 grpc_client_channel_get_subchannel_call(grpc_call_element* elem);
58 #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H */