In the Creating an echo server recipe of this chapter, we created an echo server using CFNetworking and tested it with the telnet command. In this recipe, we will create an echo client that can be used to test the echo server. Also note that the echo client and server applications created in Chapter 1, BSD Socket Library, can be used interchangeably with the echo client and server applications created in this chapter.
This recipe is compatible with both iOS and OS X. No extra frameworks or libraries are required.
The following is the code snippet for creating the
CFSocketClient header file:
#import <Foundation/Foundation.h> typedef NS_ENUM(NSUInteger, ...