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
2842f45c
Commit
2842f45c
authored
9 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
dhtchat: show public key ID
parent
8fd71c7f
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/dhtchat.cpp
+6
-3
6 additions, 3 deletions
tools/dhtchat.cpp
with
6 additions
and
3 deletions
tools/dhtchat.cpp
+
6
−
3
View file @
2842f45c
...
...
@@ -38,6 +38,11 @@ const std::string printTime(const std::time_t& now) {
return
buf
;
}
void
print_node_info
(
const
DhtRunner
&
dht
,
const
dht_params
&
params
)
{
std
::
cout
<<
"OpenDht node "
<<
dht
.
getNodeId
()
<<
" running on port "
<<
dht
.
getBoundPort
()
<<
std
::
endl
;
std
::
cout
<<
"Public key ID "
<<
dht
.
getId
()
<<
std
::
endl
;
}
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -53,8 +58,7 @@ main(int argc, char **argv)
if
(
not
params
.
bootstrap
.
first
.
empty
())
dht
.
bootstrap
(
params
.
bootstrap
.
first
.
c_str
(),
params
.
bootstrap
.
second
.
c_str
());
std
::
cout
<<
"OpenDht node "
<<
dht
.
getNodeId
()
<<
" running on port "
<<
params
.
port
<<
std
::
endl
;
std
::
cout
<<
"Public key ID "
<<
dht
.
getId
()
<<
std
::
endl
;
print_node_info
(
dht
,
params
);
std
::
cout
<<
" type 'c {hash}' to join a channel"
<<
std
::
endl
<<
std
::
endl
;
bool
connected
{
false
};
...
...
@@ -114,7 +118,6 @@ main(int argc, char **argv)
std
::
cout
<<
"Message publishing failed !"
<<
std
::
endl
;
});
}
else
{
std
::
getline
(
iss
,
line
);
dht
.
putSigned
(
room
,
dht
::
ImMessage
(
rand_id
(
rd
),
std
::
move
(
line
),
now
),
[](
bool
ok
)
{
//dht.cancelPut(room, id);
if
(
not
ok
)
...
...
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