Closed anderspitman closed 8 months ago
I believe I've solved the problem. My misunderstanding is that I was assuming CancelWrite()
was the correct way to close the send side of a stream. But according to the go-quic
docs here, calling Close
is the way to do it. I had assumed that would also close the receive side, but that's not the case. After sawpping CancelWrite
for Close
my code appears to be working.
@marten-seemann would you be interested in a PR that adds an examples directory and a simple echo server example, or is that not something you want in the repo?
Looks like I'm not the first to struggle with this: https://github.com/quic-go/webtransport-go/issues/103
Sure, sounds like a good idea! Want to create a PR?
Submitted #122
I think I have some fundamental misunderstandings about how to use this library. I'm trying to get a simple echo server running. The following is a self-contained example (uses certmagic to automatically get Let's Encrypt certs):
I'm never seeing anything printed, either on the client or server side. Interestingly, if I sleep for a second before
stream.CancelWrite(0)
then I get an error log: "stream canceled with error code 0". I think I'm incorrectly assuming that EOF will be sent after a call toCancelWrite
. Is that not the case? If not, is there a correct way to signal end of stream from the writer side?