Question: Write a C server program that takes the port value to listen to as command line arguments. If no command line arguments were given, ask
Write a C server program that takes the port value to listen to as command line arguments. If no command line arguments were given, ask the user to enter the port value. Then, the program accepts a connection from the clients and writes the message: "Connected to client xx.xx.xx.xx port xxx at time hh:mm:ss" When a command is read from the client it should be displayed on the server as well. When the client exits display the message: Client xx.xx.xx.xx port xxx disconnected at time hh:mm:ss". The program should handle all system errors or user mistakes with suitable and clear messages. You must use "getnameinfo" and "getaddrinfo" functions. b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
