Skip to content
GitLab
Menu
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
34421451
Commit
34421451
authored
Sep 13, 2017
by
Steven Allen
Browse files
reset on error in reconnect test
parent
6b6687f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
p2p/test/reconnects/reconnect_test.go
View file @
34421451
...
...
@@ -31,8 +31,12 @@ func EchoStreamHandler(stream inet.Stream) {
c
:=
stream
.
Conn
()
log
.
Debugf
(
"%s echoing %s"
,
c
.
LocalPeer
(),
c
.
RemotePeer
())
go
func
()
{
defer
stream
.
Close
()
io
.
Copy
(
stream
,
stream
)
_
,
err
:=
io
.
Copy
(
stream
,
stream
)
if
err
==
nil
{
stream
.
Close
()
}
else
{
stream
.
Reset
()
}
}()
}
...
...
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