Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
2afb270d
Commit
2afb270d
authored
10 years ago
by
Nicolas "Pixel" Noble
Browse files
Options
Downloads
Patches
Plain Diff
API change - fixing old code and doc.
parent
7f9a6376
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cpp/cpptutorial.md
+2
-2
2 additions, 2 deletions
cpp/cpptutorial.md
cpp/helloworld/greeter_server.cc
+1
-1
1 addition, 1 deletion
cpp/helloworld/greeter_server.cc
cpp/route_guide/route_guide_server.cc
+1
-1
1 addition, 1 deletion
cpp/route_guide/route_guide_server.cc
with
4 additions
and
4 deletions
cpp/cpptutorial.md
+
2
−
2
View file @
2afb270d
...
...
@@ -214,7 +214,7 @@ void RunServer(const std::string& db_path) {
RouteGuideImpl
service
(
db_path
);
ServerBuilder
builder
;
builder
.
AddPort
(
server_address
,
grpc
::
InsecureServerCredentials
());
builder
.
Add
Listening
Port
(
server_address
,
grpc
::
InsecureServerCredentials
());
builder
.
RegisterService
(
&
service
);
std
::
unique_ptr
<
Server
>
server
(
builder
.
BuildAndStart
());
std
::
cout
<<
"Server listening on "
<<
server_address
<<
std
::
endl
;
...
...
@@ -225,7 +225,7 @@ As you can see, we build and start our server using a `ServerBuilder`. To do thi
1.
Create an instance of our service implementation class
`RouteGuideImpl`
.
2.
Create an instance of the factory
`ServerBuilder`
class.
3.
Specify the address and port we want to use to listen for client requests using the builder's
`AddPort()`
method.
3.
Specify the address and port we want to use to listen for client requests using the builder's
`Add
Listening
Port()`
method.
4.
Register our service implementation with the builder.
5.
Call
`BuildAndStart()`
on the builder to create and start an RPC server for our service.
5.
Call
`Wait()`
on the server to do a blocking wait until process is killed or
`Shutdown()`
is called.
...
...
This diff is collapsed.
Click to expand it.
cpp/helloworld/greeter_server.cc
+
1
−
1
View file @
2afb270d
...
...
@@ -65,7 +65,7 @@ void RunServer() {
GreeterServiceImpl
service
;
ServerBuilder
builder
;
builder
.
AddPort
(
server_address
,
grpc
::
InsecureServerCredentials
());
builder
.
Add
Listening
Port
(
server_address
,
grpc
::
InsecureServerCredentials
());
builder
.
RegisterService
(
&
service
);
std
::
unique_ptr
<
Server
>
server
(
builder
.
BuildAndStart
());
std
::
cout
<<
"Server listening on "
<<
server_address
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
cpp/route_guide/route_guide_server.cc
+
1
−
1
View file @
2afb270d
...
...
@@ -187,7 +187,7 @@ void RunServer(const std::string& db_path) {
RouteGuideImpl
service
(
db_path
);
ServerBuilder
builder
;
builder
.
AddPort
(
server_address
,
grpc
::
InsecureServerCredentials
());
builder
.
Add
Listening
Port
(
server_address
,
grpc
::
InsecureServerCredentials
());
builder
.
RegisterService
(
&
service
);
std
::
unique_ptr
<
Server
>
server
(
builder
.
BuildAndStart
());
std
::
cout
<<
"Server listening on "
<<
server_address
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment