quic-go/webtransport-go

ReadAll() Implementation for bidirectional stream

moksh-samespace opened this issue · 2 comments

Quic-go support ReadAll() for bidirectional stream. Is there any way to achieve this in webtransport-go?

That's standard library functionality.

Can you help with an example how I can achieve this

Current Implementation:
`
stream, err := conn.AcceptStream(conn.Context())
if err != nil {
fmt.Println("Session closed, not accepting more bidi streams:", err)
break
}

for {
buf := make([]byte, 1024)
n, err := stream.Read(buf)
if err != nil {
fmt.Printf("Error reading from bidi stream %v\n", err)
break
}
}
`

Required:
buf, err := stream.ReadAll()