I can't seem to find the answer to this anywhere, but does read:maxLength: on NSInputStream block until data is available or there is an error, or do I need to poll on hasBytesAvailable before attempting to read?
Does -[NSInputStream read:maxLength:] block?
818 Views Asked by Patrick McDaniel At
1
There are 1 best solutions below
Related Questions in COCOA-TOUCH
- How to generate request format for WCF web service method for Mac and iPhone
- Application crashes when move from main view controller to another view controller, asks call a stack
- What sort of assets does PHAssetMediaTypeAudio fetch?
- Handoff icon not disappearing from the phone
- How can I use AutoLayout to place view exactly above other?
- How display notification on IOS 8 like in google maps in navigation time
- How can I modally present a UIViewController on another Storyboard that's embedded in a UINavigationController?
- Imports and includes in header files - when is it okay?
- How to listen to changes in Camera authorization status?
- What types/sizes of images do you need when using UIImage full screen?
- Change position of UIImageView when Animating in NSArray
- UITableViewAutomaticDimension + AFNetworking
- Get name of img from for loop
- Multiple CGContextRefs?
- How do i change for background colors or themes for all my screens while clicking one button in setting page for my app in ios, Using objectve c
Related Questions in COCOA
- How do I customize NSOutlineView to have border color?
- How to generate request format for WCF web service method for Mac and iPhone
- How to Handle Command Line Prompt from a Cocoa App
- Change views inside NSSplitViewController
- CMYK NSImage get pixel data
- Reactive Cocoa Conditional Split ?
- Set background color of NSImageView with proportionally sized image
- Use NSWindow or NSViewController?
- Imports and includes in header files - when is it okay?
- How to prevent the app from automatically open a window when launched?
- Swift NSViewController responds to mouseDown event, but not keyDown event
- "stringByAddingPercentEncodingWithAllowedCharacters" replaces more characters than it should
- cocoa - what happen when close a window (by pressing the red X button)?
- Does it necessary to go back to main thread to update UI?
- WebView not responding to Keyboard input
Related Questions in BLOCKING
- Add a larger number of block users via one Twitter Api request
- Multithreading using Blocking IO corrupts file in Java
- How can I reliably clean up Rust threads performing blocking IO?
- I can not take a critical section
- blocking read(1) with timeout in pyserial
- How to invoke an oozie workflow via shell script and block/wait till workflow completion
- Bulkheading strategies for Akka actors
- CUDA streams are blocking despite Async
- How to end a thread handling socket connection?
- WKWebView block certain scripts while loading any URL (Block tracking or Ads in any website)
- Does sleep() block?
- How to get large data via mongoose non-blocking?
- Does Task<T>.Result block if the task is Completed?
- Immidiate vs synchronous communication in openmpi
- JavaFX Block the UI (and the code) until a server call is finished
Related Questions in NSINPUTSTREAM
- How to convert NSInputStream to NSString or how to read NSInputStream
- How to convert NSStream (NSInputStream / NSOutputStream) to SSL after stream opened?
- What's the best way to consume the bytes of NSData?
- I cannot initialize a NSInputStream
- How to create a NSInputStream/NSOutputStream pair by accepting a server socket?
- iOS - Setting delegate of input stream to another class
- Does -[NSInputStream read:maxLength:] block?
- NSStreamDelegate not receiving messages
- Scheduling stream on NSRunLoop
- Not getting more messages after receiving first message from Java server in iOS client using NSInputStream
- Using NSXMLParser initWithStream: no parser delegate methods received
- How to correctly measure NSInputStream data rate
- iOS7 comparison of constant with expression is always false
- Error deserializing json stream
- What Am I Missing? : iPhone Objective-C NSInputStream initWithData
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Yes,
read:maxLength:blocks until after at least one byte is available, or if an error occurred or if the stream reached EOS. It will also block until after the stream is opened.Whether you want to poll or if you are fine with blocking or if you want to implement the stream delegates is up to you. It is recommended to use the stream delegates.