In the Creating an echo server recipe of this chapter, we created an echo server and then tested it using telnet. Creating the server was pretty fun, but testing with telnet was a kind of anti-climax; so in this recipe, we will be creating a client that we can use to connect to our echo server.
When we created the echo server, we created a
BSDSocketServer class to help with the creation of our server applications. In this recipe, we will be creating a
BSDSocketClient class to help with the creation of our client applications.
This recipe is compatible with both iOS and OS X. No extra frameworks or libraries are required.
Now let's create an echo client that will communicate with our echo server: