Making an Echo Client
00:00 In this lesson, you’ll learn about the client that will connect with the echo server example. The client begins with phase two of the process, where it creates a socket to connect with the server, and those instructions are much simpler than the server’s.
This data usually includes information about what resource of the server it would like, but in this example, the request is simply data that will be echoed back identically. Here, the familiar message
b preceding the string means that this data will be sent in 8-bit units. The client then waits to receive whatever data the sender will send back, and that will be stored in the variable
01:57 First, the client sends the data to the server, then attempts to receive the server’s data back. Then, having no other use for the server, this block of code ends, and the connection is closed, and the client then displays the data it received.
Become a Member to join the conversation.