One particular method of asynchronously working with sockets is by using streams, provided by
A stream by definition in the programming arena is the serialization of data transmitted between two points. For the purposes of this chapter, we will be discussing streams as they relate to socket programming and network performance rather than the full range of
NSStream capabilities, such as reading and writing to files and memory and so on.
Streams provide us with an abstraction layer to read and write data while taking advantage of the benefits of the delegate pattern that Objective-C developers are comfortable with. Essentially, this means wrapping the low-level socket development that might otherwise be needed in a nice little package ...