Creating an echo client

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.

Getting ready

This recipe is compatible with both iOS and OS X. No extra frameworks or libraries are required.

How to do it...

Let's begin!

Creating the CFSocketClient header file

The following is the code snippet for creating the CFSocketClient header file:

#import <Foundation/Foundation.h> typedef NS_ENUM(NSUInteger, ...

Get iOS and OS X Network Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.