Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions quicbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,25 @@ type MyConn struct {
}

func (this *MyConn) Read(b []byte) (n int, err error) {
len, err := this.Conn.Read(b)
n, err = this.Conn.Read(b)

if err == nil {
this.result.readThroughput += int64(len)
this.result.readThroughput += int64(n)
this.Conn.SetReadDeadline(time.Now().Add(this.readTimeout))
}

return len, err
return
}

func (this *MyConn) Write(b []byte) (n int, err error) {
len, err := this.Conn.Write(b)
n, err = this.Conn.Write(b)

if err == nil {
this.result.writeThroughput += int64(len)
this.result.writeThroughput += int64(n)
this.Conn.SetWriteDeadline(time.Now().Add(this.writeTimeout))
}

return len, err
return
}

func init() {
Expand Down