Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
z
Classes
Class List
Class Hierarchy
Class Members
All
:
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Properties
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
grpc
examples
cpp
features
unix_abstract
examples/cpp/features/unix_abstract/server.cc
Go to the documentation of this file.
1
// Copyright 2021 the gRPC authors.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#include <iostream>
16
#include <memory>
17
#include <string>
18
19
#include "examples/protos/helloworld.grpc.pb.h"
20
21
#include <
grpcpp/ext/proto_server_reflection_plugin.h
>
22
#include <
grpcpp/grpcpp.h
>
23
#include <
grpcpp/health_check_service_interface.h
>
24
25
using
grpc::Server
;
26
using
grpc::ServerBuilder
;
27
using
grpc::ServerContext
;
28
using
grpc::Status
;
29
using
helloworld::Greeter
;
30
using
helloworld::HelloReply
;
31
using
helloworld::HelloRequest
;
32
33
// Logic and data behind the server's behavior.
34
class
GreeterServiceImpl
final :
public
Greeter::Service {
35
Status
SayHello
(
ServerContext
*
context
,
const
HelloRequest
*
request
,
36
HelloReply
* reply)
override
{
37
reply->set_message(
request
->name());
38
std::cout <<
"Echoing: "
<<
request
->name() << std::endl;
39
return
Status::OK
;
40
}
41
};
42
43
void
RunServer
() {
44
std::string
server_address
(
"unix-abstract:grpc%00abstract"
);
45
GreeterServiceImpl
service
;
46
grpc::EnableDefaultHealthCheckService
(
true
);
47
grpc::reflection::InitProtoReflectionServerBuilderPlugin
();
48
ServerBuilder
builder
;
49
builder
.AddListeningPort(
server_address
,
grpc::InsecureServerCredentials
());
50
builder
.RegisterService(&
service
);
51
std::unique_ptr<Server>
server
(
builder
.BuildAndStart());
52
std::cout <<
"Server listening on "
<<
server_address
<<
" ... "
;
53
server
->Wait();
54
}
55
56
int
main
(
int
argc,
char
** argv) {
57
RunServer
();
58
59
return
0;
60
}
grpc::ServerContext
Definition:
grpcpp/impl/codegen/server_context.h:566
grpc::EnableDefaultHealthCheckService
void EnableDefaultHealthCheckService(bool enable)
Definition:
health_check_service.cc:30
proto_server_reflection_plugin.h
benchmark.request
request
Definition:
benchmark.py:77
testing::internal::string
::std::string string
Definition:
bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
framework.rpc.grpc_channelz.Server
Server
Definition:
grpc_channelz.py:42
health_check_service_interface.h
hellostreamingworld_pb2.HelloRequest
HelloRequest
Definition:
hellostreamingworld_pb2.py:102
OK
@ OK
Definition:
cronet_status.h:43
server_address
std::string server_address("0.0.0.0:10000")
server
std::unique_ptr< Server > server
Definition:
channelz_service_test.cc:330
profile_analyzer.builder
builder
Definition:
profile_analyzer.py:159
GreeterServiceImpl::SayHello
Status SayHello(ServerContext *context, const HelloRequest *request, HelloReply *reply) override
Definition:
examples/cpp/features/unix_abstract/server.cc:35
grpc::ServerBuilder
A builder class for the creation and startup of grpc::Server instances.
Definition:
grpcpp/server_builder.h:86
grpcpp.h
helloworld.Greeter
Definition:
helloworld.py:32
GreeterServiceImpl
Definition:
grpc-helloworld.cc:39
hellostreamingworld_pb2.HelloReply
HelloReply
Definition:
hellostreamingworld_pb2.py:109
main
int main(int argc, char **argv)
Definition:
examples/cpp/features/unix_abstract/server.cc:56
server
Definition:
examples/python/async_streaming/server.py:1
grpc::protobuf::util::Status
GRPC_CUSTOM_UTIL_STATUS Status
Definition:
include/grpcpp/impl/codegen/config_protobuf.h:93
grpc::Status
Definition:
include/grpcpp/impl/codegen/status.h:35
grpc::InsecureServerCredentials
std::shared_ptr< ServerCredentials > InsecureServerCredentials()
Definition:
insecure_server_credentials.cc:52
context
grpc::ClientContext context
Definition:
istio_echo_server_lib.cc:61
service
__attribute__((deprecated("Please use GRPCProtoMethod."))) @interface ProtoMethod NSString * service
Definition:
ProtoMethod.h:25
RunServer
void RunServer()
Definition:
examples/cpp/features/unix_abstract/server.cc:43
grpc::reflection::InitProtoReflectionServerBuilderPlugin
void InitProtoReflectionServerBuilderPlugin()
Definition:
proto_server_reflection_plugin.cc:66
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:16