Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
7702e9b8
Commit
7702e9b8
authored
7 years ago
by
Aviv Eyal
Committed by
Steven Allen
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Minor code cleanup
parent
49182bcf
master
2018-Q4-OKR
feat/protobuf
fix/473
fix/no-custom-field
fix/reset-ping-stream
fix/revert-correct-external-addr
gx/update-nza0mn
jenkinsfile
multistream-ping
punching
v6.0.23
v6.0.22
v6.0.21
v6.0.20
v6.0.19
v6.0.18
v6.0.17
v6.0.16
v6.0.15
v6.0.14
v6.0.13
v6.0.12
v6.0.11
v6.0.10
v6.0.9
v6.0.8
v6.0.7
v6.0.6
v6.0.5
v6.0.4
v6.0.3
v6.0.2
v6.0.1
v6.0.0
v5.0.21
v5.0.20
v5.0.19
v5.0.18
v5.0.17
v5.0.16
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/multipro/echo.go
+0
-4
examples/multipro/echo.go
examples/multipro/main.go
+1
-3
examples/multipro/main.go
examples/multipro/ping.go
+0
-4
examples/multipro/ping.go
with
1 addition
and
11 deletions
+1
-11
examples/multipro/echo.go
View file @
7702e9b8
...
...
@@ -50,8 +50,6 @@ func (e *EchoProtocol) onEchoRequest(s inet.Stream) {
if
!
valid
{
log
.
Println
(
"Failed to authenticate message"
)
return
}
else
{
//log.Println("Authenticated request content was generated by author node :-)")
}
log
.
Printf
(
"%s: Sending echo response to %s. Message id: %s..."
,
s
.
Conn
()
.
LocalPeer
(),
s
.
Conn
()
.
RemotePeer
(),
data
.
MessageData
.
Id
)
...
...
@@ -100,8 +98,6 @@ func (e *EchoProtocol) onEchoResponse(s inet.Stream) {
if
!
valid
{
log
.
Println
(
"Failed to authenticate message"
)
return
}
else
{
//log.Println("Authenticated response content generated by claimed node :-)")
}
// locate request data and remove it if found
...
...
This diff is collapsed.
Click to expand it.
examples/multipro/main.go
View file @
7702e9b8
...
...
@@ -27,8 +27,6 @@ func makeRandomNode(port int, done chan bool) *Node {
n
,
_
:=
swarm
.
NewNetwork
(
context
.
Background
(),
[]
ma
.
Multiaddr
{
listen
},
pid
,
peerStore
,
nil
)
host
:=
bhost
.
New
(
n
)
log
.
Printf
(
"New host id (base58 multihash):%s, length:%d"
,
host
.
ID
()
.
Pretty
(),
len
(
host
.
ID
()
.
Pretty
()))
return
NewNode
(
host
,
done
)
}
...
...
@@ -48,7 +46,7 @@ func main() {
log
.
Printf
(
"This is a conversation between %s and %s
\n
"
,
h1
.
ID
(),
h2
.
ID
())
//
send messages using the
protocols
//
test implemented
protocols
h1
.
Ping
(
h2
.
Host
)
h2
.
Ping
(
h1
.
Host
)
h1
.
Echo
(
h2
.
Host
)
...
...
This diff is collapsed.
Click to expand it.
examples/multipro/ping.go
View file @
7702e9b8
...
...
@@ -51,8 +51,6 @@ func (p *PingProtocol) onPingRequest(s inet.Stream) {
if
!
valid
{
log
.
Println
(
"Failed to authenticate message"
)
return
}
else
{
//log.Println("Authenticated request content was generated by claimed node :-)")
}
// generate response message
...
...
@@ -99,8 +97,6 @@ func (p *PingProtocol) onPingResponse(s inet.Stream) {
if
!
valid
{
log
.
Println
(
"Failed to authenticate message"
)
return
}
else
{
//log.Println("Authenticated response content generated by claimed node :-)")
}
// locate request data and remove it if found
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help