Go to the documentation of this file.
26 #include "examples/protos/helloworld.grpc.pb.h"
28 #include "helloworld.grpc.pb.h"
46 std::cout <<
"Client metadata: " << std::endl;
47 const std::multimap<grpc::string_ref, grpc::string_ref>
metadata =
50 std::cout <<
"Header key: " <<
iter->first <<
", value: ";
52 size_t isbin =
iter->first.find(
"-bin");
53 if ((isbin != std::string::npos) && (isbin + 4 ==
iter->first.size())) {
54 std::cout << std::hex;
55 for (
auto c :
iter->second) {
56 std::cout << static_cast<unsigned int>(
c);
58 std::cout << std::dec;
60 std::cout <<
iter->second;
62 std::cout << std::endl;
65 context->AddInitialMetadata(
"custom-server-metadata",
66 "initial metadata value");
67 context->AddTrailingMetadata(
"custom-trailing-metadata",
68 "trailing metadata value");
86 std::cout <<
"Server listening on " <<
server_address << std::endl;
93 int main(
int argc,
char** argv) {
std::string server_address("0.0.0.0:10000")
std::unique_ptr< Server > server
Status SayHello(ServerContext *context, const HelloRequest *request, HelloReply *reply) override
A builder class for the creation and startup of grpc::Server instances.
static const char prefix[]
GRPC_CUSTOM_UTIL_STATUS Status
std::shared_ptr< ServerCredentials > InsecureServerCredentials()
grpc::ClientContext context
__attribute__((deprecated("Please use GRPCProtoMethod."))) @interface ProtoMethod NSString * service
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:44