GRPC Core  9.0.0
chttp2_connector.h
Go to the documentation of this file.
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_TRANSPORT_CHTTP2_CLIENT_CHTTP2_CONNECTOR_H
20 #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_CHTTP2_CONNECTOR_H
21 
23 
27 
28 namespace grpc_core {
29 
31  public:
34 
35  void Connect(const Args& args, Result* result, grpc_closure* notify) override;
36  void Shutdown(grpc_error* error) override;
37 
38  private:
39  static void Connected(void* arg, grpc_error* error);
40  void StartHandshakeLocked();
41  static void OnHandshakeDone(void* arg, grpc_error* error);
42 
43  Mutex mu_;
44  Args args_;
45  Result* result_ = nullptr;
46  grpc_closure* notify_ = nullptr;
47  bool shutdown_ = false;
48  bool connecting_ = false;
49  // Holds the endpoint when first created before being handed off to
50  // the handshake manager.
51  grpc_endpoint* endpoint_ = nullptr;
52  grpc_closure connected_;
53  RefCountedPtr<HandshakeManager> handshake_mgr_;
54 };
55 
56 } // namespace grpc_core
57 
58 #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_CHTTP2_CONNECTOR_H */
Definition: error_internal.h:39
~Chttp2Connector()
Definition: chttp2_connector.cc:47
void Shutdown(grpc_error *error) override
Definition: chttp2_connector.cc:78
Round Robin Policy.
Definition: backend_metric.cc:24
Definition: connector.h:35
Definition: ref_counted_ptr.h:35
Definition: chttp2_connector.h:30
void Connect(const Args &args, Result *result, grpc_closure *notify) override
Definition: chttp2_connector.cc:51
A closure over a grpc_iomgr_cb_func.
Definition: closure.h:56
Definition: endpoint.h:102
Definition: connector.h:46
Chttp2Connector()
Definition: chttp2_connector.cc:43
Definition: sync.h:40
Definition: connector.h:37