سؤال

I cant really understand this event. I'm hoping that it is called when the sending queue (or something similar internal structure) is done sending previously written packets.

Is it a correct assumption?


I'm working on a video streamer over Multipeer connectivity, and I want to use this property to decide if I should drop a camera frame (if there is no NSStreamEventHasSpaceAvailable), or I can submit it for NSOutputStream.

Imagine a BlueTooth connection, where I really need to drop a lot of camera frame, instead of submit every frame to NSStream.

هل كانت مفيدة؟

المحلول

The NSStreamEventHasSpaceAvailable event indicates that you can write (at least one byte!) to the stream without blocking. That does not mean that previously written data is completely delivered to the other endpoint of the connection.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top