Change high/low water during dispatch io operation
| Originator: | robnapier | ||
| Number: | rdar://15175257 | Date Originated: | |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 7.0.2 |
| Classification: | Reproducible: |
Calling dispatch_io_set_high_water() does not seem to influence future the block size after the dispatch_io_read() has been called. In some cases it would be useful to be able to change this during the read. For example, when reading an HTTP stream, it is desirable to get the header as quickly as possible, since its contents may change other behaviors (establish total expected bytes for instance). Since the header is likely less than 1k, it is desirable to set a low high-water mark. However, it's precise size is unknown, so it is not desirable to limit the dispatch_io_read to a fixed length. Once the header is decoded, it is desirable to use the standard high-water mark (SIZE_MAX) so that the framework can best optimize throughput. Steps to Reproduce: See attached project. Note particularly readFromChannel:writeToChannel:queue: and the two calls to dispatch_io_set_high_water. Expected Results: The header should be read with a maximum block size of 1024, while the remainder of the stream should be read with a maximum block of SIZE_MAX. Actual Results: The entire stream is read with a maximum block size of 1024.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!