quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Question: Why the conntion is closed after RecvStream.read_buf() #1673

Closed Zhou-Pixel closed 12 months ago

Zhou-Pixel commented 1 year ago

Code

图片

Result

图片

Ralith commented 1 year ago

Did you read the documentation for ConnectionError::ApplicationClosed?

Zhou-Pixel commented 1 year ago

Did you read the documentation for ConnectionError::ApplicationClosed?

Yes, I do. The strange thing is why there is no problem reading and writing the first time, but it fails the second time, at the same time, the error_code is 0 and The reason is empty. It seems that the connection was closed manually, but I didn't close it.

Ralith commented 1 year ago

You didn't; your peer did.

Zhou-Pixel commented 12 months ago

You didn't; your peer did.

My mistake, I forgot that quic is a stream and I need to deal with the problem of sticky packets, so when the server cannot serialize the Json text, it shuts down.

Zhou-Pixel commented 12 months ago

You didn't; your peer did.

Thanks