Question: Server, as the name implies, opens a socket server on a particular port and waits for connections. Client, immediately when executed, attempts to open a
Server, as the name implies, opens a socket server on a particular port and waits for connections. Client, immediately when executed, attempts to open a socket connection on the appropriate port. Server must be designed in such a way that an arbitrary number of Clients can be run at the same time. Each one should successfully connect to a socket on the port, and display the same outward behaviour. The user interface of Client can be quite simple. It should just sit there waiting for user input. Once the user has typed a string, it sends the string to the Server over the socket connection. Once the Server receives the transmitted string, it does something to it, and sends it back. It does not metter what the Server does to the string: transform it to upper case, reverse the order of the letters, make every third letter an X, use it to index into a hash table containing the complete works of ShakespeareYou can do whatever you like, as long as the transformation carried out by Server means that the string sent from Server to Client received in reply is:
1. Not exactly the same as the string transmitted TO the Server AND
2. In some way dependent on the string transmitted TO the Server
After the Client receives the string, it prints it and asks for the next one. This process repeats untill the user enters done. When the user enters done, the Client should terminate gracefully. In other words, it should close the socket, clean up after itself, and terminate, without core dumps, unhandled exceptions, and so on. Note that entering Ctrl-C is not considered a graceful form of termination
The Server must also terminate gracefully. In this case, you can decide how to do it, either by typing something at the Server, or by sending a special command from a Client, or some other technique.
You must complete the code of the server and client below to satisfy the above requirements





28server.cpp seer.cppmain.cpp No Selection O #include "thread.h" #include #include #include #include #include #include "socketserver.h"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
