Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
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
savoirfairelinux
opendht
Commits
a298c206
Commit
a298c206
authored
9 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
dhtnode: add command b to ping a node
parent
4caa8ce1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/dhtnode.cpp
+11
-0
11 additions, 0 deletions
tools/dhtnode.cpp
with
11 additions
and
0 deletions
tools/dhtnode.cpp
+
11
−
0
View file @
a298c206
...
...
@@ -70,6 +70,7 @@ void print_help() {
<<
" lr Print the full current routing table of this node"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"Operations on the DHT:"
<<
std
::
endl
<<
" b ip:port Ping potential node at given IP address/port."
<<
std
::
endl
<<
" g [key] Get values at [key]."
<<
std
::
endl
<<
" l [key] Listen for value changes at [key]."
<<
std
::
endl
<<
" p [key] [str] Put string value at [key]."
<<
std
::
endl
...
...
@@ -155,6 +156,16 @@ main(int argc, char **argv)
for
(
const
auto
&
addr
:
addrs
)
std
::
cout
<<
addr
<<
std
::
endl
;
continue
;
}
else
if
(
op
==
"b"
)
{
try
{
auto
addr
=
splitPort
(
idstr
);
if
(
not
addr
.
first
.
empty
()
and
addr
.
second
.
empty
())
addr
.
second
=
std
::
to_string
(
DHT_DEFAULT_PORT
);
dht
.
bootstrap
(
addr
.
first
.
c_str
(),
addr
.
second
.
c_str
());
}
catch
(
const
std
::
exception
&
e
)
{
std
::
cout
<<
e
.
what
()
<<
std
::
endl
;
}
continue
;
}
else
if
(
op
==
"log"
)
{
params
.
log
=
!
params
.
log
;
if
(
params
.
log
)
...
...
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