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
05c14809
Commit
05c14809
authored
10 years ago
by
murgatroid99
Browse files
Options
Downloads
Patches
Plain Diff
Updated client and server to use db from a variable path
parent
ce02e0db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/node/examples/route_guide_client.js
+6
-1
6 additions, 1 deletion
src/node/examples/route_guide_client.js
src/node/examples/route_guide_server.js
+6
-1
6 additions, 1 deletion
src/node/examples/route_guide_server.js
with
12 additions
and
2 deletions
src/node/examples/route_guide_client.js
+
6
−
1
View file @
05c14809
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
var
async
=
require
(
'
async
'
);
var
async
=
require
(
'
async
'
);
var
fs
=
require
(
'
fs
'
);
var
fs
=
require
(
'
fs
'
);
var
parseArgs
=
require
(
'
minimist
'
);
var
path
=
require
(
'
path
'
);
var
_
=
require
(
'
underscore
'
);
var
_
=
require
(
'
underscore
'
);
var
grpc
=
require
(
'
..
'
);
var
grpc
=
require
(
'
..
'
);
var
examples
=
grpc
.
load
(
__dirname
+
'
/route_guide.proto
'
).
examples
;
var
examples
=
grpc
.
load
(
__dirname
+
'
/route_guide.proto
'
).
examples
;
...
@@ -104,7 +106,10 @@ function runListFeatures(callback) {
...
@@ -104,7 +106,10 @@ function runListFeatures(callback) {
* @param {function} callback Called when this demo is complete
* @param {function} callback Called when this demo is complete
*/
*/
function
runRecordRoute
(
callback
)
{
function
runRecordRoute
(
callback
)
{
fs
.
readFile
(
__dirname
+
'
/route_guide_db.json
'
,
function
(
err
,
data
)
{
var
argv
=
parseArgs
(
process
.
argv
,
{
string
:
'
db_path
'
});
fs
.
readFile
(
path
.
resolve
(
argv
.
db_path
),
function
(
err
,
data
)
{
if
(
err
)
callback
(
err
);
if
(
err
)
callback
(
err
);
var
feature_list
=
JSON
.
parse
(
data
);
var
feature_list
=
JSON
.
parse
(
data
);
...
...
This diff is collapsed.
Click to expand it.
src/node/examples/route_guide_server.js
+
6
−
1
View file @
05c14809
...
@@ -28,6 +28,8 @@
...
@@ -28,6 +28,8 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var
fs
=
require
(
'
fs
'
);
var
fs
=
require
(
'
fs
'
);
var
parseArgs
=
require
(
'
minimist
'
);
var
path
=
require
(
'
path
'
);
var
_
=
require
(
'
underscore
'
);
var
_
=
require
(
'
underscore
'
);
var
grpc
=
require
(
'
..
'
);
var
grpc
=
require
(
'
..
'
);
var
examples
=
grpc
.
load
(
__dirname
+
'
/route_guide.proto
'
).
examples
;
var
examples
=
grpc
.
load
(
__dirname
+
'
/route_guide.proto
'
).
examples
;
...
@@ -234,7 +236,10 @@ if (require.main === module) {
...
@@ -234,7 +236,10 @@ if (require.main === module) {
// If this is run as a script, start a server on an unused port
// If this is run as a script, start a server on an unused port
var
routeServer
=
getServer
();
var
routeServer
=
getServer
();
routeServer
.
bind
(
'
0.0.0.0:50051
'
);
routeServer
.
bind
(
'
0.0.0.0:50051
'
);
fs
.
readFile
(
__dirname
+
'
/route_guide_db.json
'
,
function
(
err
,
data
)
{
var
argv
=
parseArgs
(
process
.
argv
,
{
string
:
'
db_path
'
});
fs
.
readFile
(
path
.
resolve
(
argv
.
db_path
),
function
(
err
,
data
)
{
if
(
err
)
throw
err
;
if
(
err
)
throw
err
;
feature_list
=
JSON
.
parse
(
data
);
feature_list
=
JSON
.
parse
(
data
);
routeServer
.
listen
();
routeServer
.
listen
();
...
...
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