From the course: Network Programming in C: Develop Reliable Client/Server Applications

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Challenge: Code a UDP client and server

Challenge: Code a UDP client and server

(lively music) - [Instructor] Many servers exist to provide functions that carry out individual tasks. They act as a type of distributed system, allowing other computers on a network to share these processing chores. Your goal for this challenge is to construct such a server at a simple level, as well as construct its companion client program. First, code a UDP server that accepts a string of data. The server reverses the strings characters, so that ABCD becomes DCBA. The server then returns the reversed string to the client and quits. Second, code a UDP client that prompts the user for a string of text. Ensure that you remove the new line character from the text input, as this character can mess up the reversed text output. Connect with a UDP server and send the string, then capture the return string and output it. Here's a sample run of my solution. The server is running in the background, so I'm going to run the…

Contents