http2_client.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2016 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_TEST_CPP_INTEROP_HTTP2_CLIENT_H
20 #define GRPC_TEST_CPP_INTEROP_HTTP2_CLIENT_H
21 
22 #include <memory>
23 
24 #include <grpc/grpc.h>
25 #include <grpcpp/channel.h>
26 
27 #include "src/proto/grpc/testing/messages.pb.h"
28 #include "src/proto/grpc/testing/test.grpc.pb.h"
29 
30 namespace grpc {
31 namespace testing {
32 
33 class Http2Client {
34  public:
35  explicit Http2Client(const std::shared_ptr<Channel>& channel);
37 
38  bool DoRstAfterHeader();
39  bool DoRstAfterData();
40  bool DoRstDuringData();
41  bool DoGoaway();
42  bool DoPing();
43  bool DoMaxStreams();
44 
45  private:
46  class ServiceStub {
47  public:
48  explicit ServiceStub(const std::shared_ptr<Channel>& channel);
49 
50  TestService::Stub* Get();
51 
52  private:
53  std::unique_ptr<TestService::Stub> stub_;
54  std::shared_ptr<Channel> channel_;
55  };
56 
57  void MaxStreamsWorker(const std::shared_ptr<grpc::Channel>& channel);
58  bool AssertStatusCode(const Status& s, StatusCode expected_code);
62  std::shared_ptr<Channel> channel_;
64 };
65 
66 } // namespace testing
67 } // namespace grpc
68 
69 #endif // GRPC_TEST_CPP_INTEROP_HTTP2_CLIENT_H
messages_pb2.SimpleRequest
SimpleRequest
Definition: messages_pb2.py:597
testing
Definition: aws_request_signer_test.cc:25
grpc::testing::Http2Client::MaxStreamsWorker
void MaxStreamsWorker(const std::shared_ptr< grpc::Channel > &channel)
Definition: http2_client.cc:143
grpc
Definition: grpcpp/alarm.h:33
grpc::testing::Http2Client::AssertStatusCode
bool AssertStatusCode(const Status &s, StatusCode expected_code)
Definition: http2_client.cc:57
grpc::testing::Http2Client::ServiceStub
Definition: http2_client.h:46
grpc::testing::Http2Client::channel_
std::shared_ptr< Channel > channel_
Definition: http2_client.h:62
grpc::testing::Http2Client::ServiceStub::channel_
std::shared_ptr< Channel > channel_
Definition: http2_client.h:54
grpc::testing::Http2Client::DoGoaway
bool DoGoaway()
Definition: http2_client.cc:113
grpc::testing::Http2Client
Definition: http2_client.h:33
grpc::testing::Http2Client::serviceStub_
ServiceStub serviceStub_
Definition: http2_client.h:61
channel
wrapped_grpc_channel * channel
Definition: src/php/ext/grpc/call.h:33
grpc::testing::Http2Client::defaultRequest_
SimpleRequest defaultRequest_
Definition: http2_client.h:63
grpc.StatusCode
Definition: src/python/grpcio/grpc/__init__.py:232
grpc.h
grpc::testing::Http2Client::DoRstDuringData
bool DoRstDuringData()
Definition: http2_client.cc:102
channel.h
grpc::testing::Http2Client::DoPing
bool DoPing()
Definition: http2_client.cc:133
grpc::testing::Http2Client::DoRstAfterData
bool DoRstAfterData()
Definition: http2_client.cc:91
grpc::testing::Http2Client::~Http2Client
~Http2Client()
Definition: http2_client.h:36
grpc::testing::Http2Client::ServiceStub::ServiceStub
ServiceStub(const std::shared_ptr< Channel > &channel)
Definition: http2_client.cc:45
grpc::testing::Http2Client::DoMaxStreams
bool DoMaxStreams()
Definition: http2_client.cc:151
grpc::testing::Http2Client::BuildDefaultRequest
SimpleRequest BuildDefaultRequest()
Definition: http2_client.cc:72
grpc::testing::Http2Client::Http2Client
Http2Client(const std::shared_ptr< Channel > &channel)
Definition: http2_client.cc:52
grpc::testing::Http2Client::ServiceStub::Get
TestService::Stub * Get()
Definition: http2_client.cc:50
asyncio_get_stats.response
response
Definition: asyncio_get_stats.py:28
grpc::Status
Definition: include/grpcpp/impl/codegen/status.h:35
grpc::testing::Http2Client::ServiceStub::stub_
std::unique_ptr< TestService::Stub > stub_
Definition: http2_client.h:53
messages_pb2.SimpleResponse
SimpleResponse
Definition: messages_pb2.py:604
grpc::testing::Http2Client::DoRstAfterHeader
bool DoRstAfterHeader()
Definition: http2_client.cc:80
grpc::testing::Http2Client::SendUnaryCall
Status SendUnaryCall(SimpleResponse *response)
Definition: http2_client.cc:67


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:13