external_connection_acceptor_impl.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2019 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 SRC_CPP_SERVER_EXTERNAL_CONNECTION_ACCEPTOR_IMPL_H_
20 #define SRC_CPP_SERVER_EXTERNAL_CONNECTION_ACCEPTOR_IMPL_H_
21 
22 #include <memory>
23 #include <string>
24 
26 #include <grpcpp/server_builder.h>
28 #include <grpcpp/support/config.h>
29 
32 
33 namespace grpc {
34 namespace internal {
35 
37  : public std::enable_shared_from_this<ExternalConnectionAcceptorImpl> {
38  public:
40  const std::string& name,
42  std::shared_ptr<ServerCredentials> creds);
43  // Should only be called once.
44  std::unique_ptr<experimental::ExternalConnectionAcceptor> GetAcceptor();
45 
48 
49  void Shutdown();
50 
51  void Start();
52 
53  const char* name() { return name_.c_str(); }
54 
56 
58 
59  private:
61  std::shared_ptr<ServerCredentials> creds_;
62  grpc_core::TcpServerFdHandler* handler_ = nullptr; // not owned
64  bool has_acceptor_ = false;
65  bool started_ = false;
66  bool shutdown_ = false;
67 };
68 
69 } // namespace internal
70 } // namespace grpc
71 
72 #endif // SRC_CPP_SERVER_EXTERNAL_CONNECTION_ACCEPTOR_IMPL_H_
grpc::experimental::ExternalConnectionAcceptor::NewConnectionParameters
Definition: grpcpp/server_builder.h:69
grpc_core::TcpServerFdHandler
Definition: tcp_server.h:57
grpc::internal::ExternalConnectionAcceptorImpl::mu_
grpc_core::Mutex mu_
Definition: external_connection_acceptor_impl.h:63
grpc
Definition: grpcpp/alarm.h:33
grpc::internal::ExternalConnectionAcceptorImpl::has_acceptor_
bool has_acceptor_
Definition: external_connection_acceptor_impl.h:64
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc::internal::ExternalConnectionAcceptorImpl::HandleNewConnection
void HandleNewConnection(experimental::ExternalConnectionAcceptor::NewConnectionParameters *p)
Definition: external_connection_acceptor_impl.cc:65
grpc::internal::ExternalConnectionAcceptorImpl::GetCredentials
ServerCredentials * GetCredentials()
Definition: external_connection_acceptor_impl.h:55
grpc::internal::ExternalConnectionAcceptorImpl::SetToChannelArgs
void SetToChannelArgs(grpc::ChannelArguments *args)
Definition: external_connection_acceptor_impl.cc:94
grpc::internal::ExternalConnectionAcceptorImpl
Definition: external_connection_acceptor_impl.h:36
grpc::internal::ExternalConnectionAcceptorImpl::Start
void Start()
Definition: external_connection_acceptor_impl.cc:86
grpc::internal::ExternalConnectionAcceptorImpl::name_
const std::string name_
Definition: external_connection_acceptor_impl.h:60
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
grpc::internal::ExternalConnectionAcceptorImpl::ExternalConnectionAcceptorImpl
ExternalConnectionAcceptorImpl(const std::string &name, ServerBuilder::experimental_type::ExternalConnectionType type, std::shared_ptr< ServerCredentials > creds)
Definition: external_connection_acceptor_impl.cc:47
channel_arguments.h
grpc::ServerCredentials
Wrapper around grpc_server_credentials, a way to authenticate a server.
Definition: include/grpcpp/security/server_credentials.h:76
grpc::internal::ExternalConnectionAcceptorImpl::shutdown_
bool shutdown_
Definition: external_connection_acceptor_impl.h:66
config.h
grpc::internal::ExternalConnectionAcceptorImpl::GetAcceptor
std::unique_ptr< experimental::ExternalConnectionAcceptor > GetAcceptor()
Definition: external_connection_acceptor_impl.cc:57
server_credentials.h
grpc::internal::ExternalConnectionAcceptorImpl::handler_
grpc_core::TcpServerFdHandler * handler_
Definition: external_connection_acceptor_impl.h:62
grpc::internal::ExternalConnectionAcceptorImpl::Shutdown
void Shutdown()
Definition: external_connection_acceptor_impl.cc:81
grpc::ChannelArguments
Definition: grpcpp/support/channel_arguments.h:39
grpc_core::Mutex
Definition: src/core/lib/gprpp/sync.h:61
grpc::internal::ExternalConnectionAcceptorImpl::started_
bool started_
Definition: external_connection_acceptor_impl.h:65
grpc::internal::ExternalConnectionAcceptorImpl::creds_
std::shared_ptr< ServerCredentials > creds_
Definition: external_connection_acceptor_impl.h:61
grpc::internal::ExternalConnectionAcceptorImpl::name
const char * name()
Definition: external_connection_acceptor_impl.h:53
internal
Definition: benchmark/test/output_test_helper.cc:20
grpc::ServerBuilder::experimental_type::ExternalConnectionType
ExternalConnectionType
Definition: grpcpp/server_builder.h:268
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
tcp_server.h
server_builder.h
sync.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:18