Stream payload not being sent if associated streams have no data yet #3176
Labels
needs-triage
Issue still needs to be assigned, labeled and deduplicated
type: bug
Something is broken or not working as intended
Project
Nearby Connections
Language
C++
OS Platform
Other
What happened?
[RUNNING THIS ON ANDROID]
I'm using the compiled SDK to create an Expo module to use in our future app.
So actually I'm not really aware of what happens under the hood in this codebase and I apologize in advance if this is not the right place where to post this.
I'm able to let everything working as expected (advertising, discovering, connections, etc..).
However, when trying to send a Stream payload, even if it is correctly sent (I can see a log printed in the sendPayload Task onSuccess listener), it is not received from the target endpoint.
Investigating the issue, I found out the stream payload was not sent because the associated stream had no data yet to read.
How I was generating the payload:
and then just sending it out with:
connectionsClient.sendPayload(endpointIdsStrings, payload)
it was correctly sent but not received.
As soon as I write even a single byte to the outputStream before sending the Payload, it is then correctly received on the other hand and I can continue writing my data.
As I see, e.g., Piped streams can be created and connected and just wait for new data. I don't understand why a stream payload can't be sent and waiting for it.
Thanks!
What did you expect to happen?
I would expect that I can send a Stream Payload even if no data has been written yet.
How can we reproduce it (as minimally and precisely as possible)?
How often does this bug happen?
Every time
Standalone code to reproduce the issue
Relevant log output
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: