@takt so I was running into something similar and I am still chasing it done but I have some notes worth sharing:
While you mentioned it's probably not the server side I have seen an issue (or think so) where the NWConnectionGroup is establishing an initial stream. When the connection is established to the server , you are generating a new stream and sending data which will, on the server side, trigger the stream to be "opened".
What I found was if your server side code is something like this (sudo code for readability):
conn = endpoint.accept_connection()
stream = conn.accept_new_stream()
...
let bytes = stream.recv()
You might find that your server is accepting a stream but you don't get the bytes.
AFAICT, this is because there is an initial stream being establish silently by the NWConnectionGroup which you cannot get a handle to. When you create your new stream on your client, and send data this causes the hidden stream to be opened as well per the QUIC spec:
A stream ID that is used out of order results in all streams of that type with lower-numbered stream IDs also being opened.
https://www.rfc-editor.org/rfc/rfc9000.html#name-stream-types-and-identifier
This means you have a handle to the initial hidden stream and the server will accept data from your newly open stream.
From my testing you need to make sure that your server is accepting streams multiple times:
conn = endpoint.accept_connection()
_ = conn.accept_new_stream()
stream = conn.accept_new_stream()
...
and then I found I want able to process the incoming data.
Reference this example repo and issue where I dug into this will the Rust implementation of QUIC and Network.framework
https://github.com/paxsonsa/quic-swift-demo
https://github.com/quinn-rs/quinn/issues/1742
Cheers!
Topic:
App & System Services
SubTopic:
Networking
Tags: