Home | History | Annotate | Download | only in client_channel
      1 /*
      2  *
      3  * Copyright 2015 gRPC authors.
      4  *
      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
      8  *
      9  *     http://www.apache.org/licenses/LICENSE-2.0
     10  *
     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.
     16  *
     17  */
     18 
     19 #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
     20 #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
     21 
     22 #include <grpc/support/port_platform.h>
     23 
     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"
     28 
     29 extern grpc_core::TraceFlag grpc_client_channel_trace;
     30 
     31 // Channel arg key for server URI string.
     32 #define GRPC_ARG_SERVER_URI "grpc.server_uri"
     33 
     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.
     37 
     38    Calls on a disconnected client channel are queued until a connection is
     39    established. */
     40 
     41 extern const grpc_channel_filter grpc_client_channel_filter;
     42 
     43 void grpc_client_channel_populate_child_refs(
     44     grpc_channel_element* elem, grpc_core::ChildRefsList* child_subchannels,
     45     grpc_core::ChildRefsList* child_channels);
     46 
     47 grpc_connectivity_state grpc_client_channel_check_connectivity_state(
     48     grpc_channel_element* elem, int try_to_connect);
     49 
     50 int grpc_client_channel_num_external_connectivity_watchers(
     51     grpc_channel_element* elem);
     52 
     53 void grpc_client_channel_watch_connectivity_state(
     54     grpc_channel_element* elem, grpc_polling_entity pollent,
     55     grpc_connectivity_state* state, grpc_closure* on_complete,
     56     grpc_closure* watcher_timer_init);
     57 
     58 /* Debug helper: pull the subchannel call from a call stack element */
     59 grpc_subchannel_call* grpc_client_channel_get_subchannel_call(
     60     grpc_call_element* elem);
     61 
     62 #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H */
     63