Stream not sending or receiving?

Ok I am really confused. i must be missing something simple, but I've been staring and can't figure it out. I have multiple tokio threads each with Quinn servers. Then I have a couple of them connect as a client to one of the servers. If only the first of them connects and sends a message, nothing happens. But if both connect and send a messages, both messages show up. If only the second connects, it works too. I really can't figure out why the second one is so essential. What did I do so different that matters so much?

For reference: y is the one that works. Not sure why, but it's the one that is necessary.

It's pretty long so, the code can be found here:
https://codeshare.io/vAN3jk

EDIT: What is also very strange is that the listening variable in y has to be there, but it doesn't have to do anything. Everything works as expected if it's just an empty tokio::spawn(async move{}) The loop is not essential. But if I remove that variable and the await for it, a panics no messages are sent.

So I've modified the code significantly to make it more clear.

However the behavior is a bit different now. Basically, a server only seems to receive one connection (even though default is to allow 100 concurrent streams). Also, the connection from A never seems to happen even if y or z doesn't connect. So if y goes to a or b and z goes to the other one, both connections happen, but if they both go to the same, only one connects.

I would like to share the code, but I don't know where I should post it to be shared. What would you recommend other than github? I don't want to use github. The previous sharing site apparently only shares for 24 hours and very few looked at it. Given it's length I don't think I should just post it here unless that's what you guys tell me to do (300+ lines).

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.