With stream-based communication, clients and servers are somewhat more distinct. Stream-based clients-Programs that use TCP to send and receive data as two continuous streams of bytes, one in each direction. With packet-based communication, the only differences between clients and servers are the contents of the packets that each program sends and receives, and (presumably) what each program does with the data. Packet-based communication-Programs that operate on one packet at a time, listening for incoming packets, then sending packets in reply. Socket and stream programming generally falls into one of the following broad categories: At a lower level, however, the lines are often blurry. Most programs written using high-level APIs are purely clients. The APIs described in this article should be used only if you need to support some protocol other than the protocols supported by built-in Cocoa or Core Foundation functionality.Īt almost every level of networking, software can be divided into two categories: clients (programs that connect to other apps) and services (programs that other apps connect to). To learn more about these higher-level APIs, read Networking Overview. Most programs would be better served by higher-level APIs such as NSURLConnection. Important: This article describes ways to make socket connections that are completely under the control of your program.
0 Comments
Leave a Reply. |