Commit 34421451 authored by Steven Allen's avatar Steven Allen
Browse files

reset on error in reconnect test

parent 6b6687f9
......@@ -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()
}
}()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment