Skip to content

Commit

Permalink
feat: Add better debugging support for low-throughput connections in …
Browse files Browse the repository at this point in the history
…throughput test (closes #3)
  • Loading branch information
pojntfx committed May 15, 2022
1 parent 72f5014 commit 4c778c5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/wrtcthr/wrtcthr.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ func (a *Adapter) Wait() error {
for {
read := 0
for i := 0; i < a.config.PacketCount; i++ {
if i == 0 {
log.Debug().
Str("channelID", peer.ChannelID).
Str("peerID", peer.PeerID).
Msg("Started receiving data")
}

buf := make([]byte, a.config.PacketLength)

n, err := peer.Conn.Read(buf)
Expand All @@ -188,6 +195,11 @@ func (a *Adapter) Wait() error {
read += n
}

log.Debug().
Str("channelID", peer.ChannelID).
Str("peerID", peer.PeerID).
Msg("Acknowledging received data")

if _, err := peer.Conn.Write(make([]byte, acklen)); err != nil {
log.Debug().
Err(err).
Expand Down

0 comments on commit 4c778c5

Please sign in to comment.