iOS Question AsyncStreams when it finishes transmitting data

Star-Dust

Expert
Licensed User
Longtime User
AsyncStreams is an asynchronous method and does not block the main thread.
But is it possible to know when it finishes transmitting data with aSyncStream.Write (Data)?

I better formulate the question, when does it go to the next instruction has it finished sending or does it continue while sending is still in progress?
If it continues, is there an event indicating that the sending is complete?
 

hatzisn

Well-Known Member
Licensed User
Longtime User
I use a data end signature at the end of the byte stream and when this is received I execute the code that has to follow.

Also when you send data (on the sending part) I suppose you know what you want to send and when it ends.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I use a data end signature at the end of the byte stream and when this is received I execute the code that has to follow.

Also when you send data (on the sending part) I suppose you know what you want to send and when it ends.
It is an excellent idea, but the protocol I am using is not created by me, I have to follow it as it was created and it does not include an end data character
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
No. All the communication happens in the background.

You can call AStream.SendAllAndClose to make it close automatically after it is done sending.
Yes, I understand that this is the only way to make sure that you are submitting and to close sending everything.
I needed a flush exactly.
 
Upvote 0
Top