Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is a programming assignment in C. (not C++) Write a simple HTTP client and a separate HTTP server application in C using the POSIX
This is a programming assignment in C. (not C++) Write a simple HTTP client and a separate HTTP server application in C using the POSIX socket libraries, As soon as the client connects, the server will send a html or tesmall image file which is between 10 to 50K bytes in size ideally. Have the client close the connection once the file is transmitted. Make sure the files are named differently on the client and server side, You must use the POSIX socket functions, . DO NOT implement the server handling multiple requests at the same time (multi-threading) Implement reasonable output messages that show each stage of the socket flow (e.g. "Connected to server" or "Receiving message from server", etc) Submit: client and server) Source code and make file and sample output of the file transfer (both 1. Create the C code and compile it using a make file. 2. Run it on your own machine with a port number specified in the command line For example, type: prog2server 25000) If a service is already running on the port you choose, you will get a BindException or a similar exception. USE THE PORTS YOU WERE ASSIGNED 3. In another window, use Telnet as the client program by typing a command telnet localhost 25000 . This will test that the Server application is working 4. Now test using the C client by typing: prog2client 25000 This is a programming assignment in C. (not C++) Write a simple HTTP client and a separate HTTP server application in C using the POSIX socket libraries, As soon as the client connects, the server will send a html or tesmall image file which is between 10 to 50K bytes in size ideally. Have the client close the connection once the file is transmitted. Make sure the files are named differently on the client and server side, You must use the POSIX socket functions, . DO NOT implement the server handling multiple requests at the same time (multi-threading) Implement reasonable output messages that show each stage of the socket flow (e.g. "Connected to server" or "Receiving message from server", etc) Submit: client and server) Source code and make file and sample output of the file transfer (both 1. Create the C code and compile it using a make file. 2. Run it on your own machine with a port number specified in the command line For example, type: prog2server 25000) If a service is already running on the port you choose, you will get a BindException or a similar exception. USE THE PORTS YOU WERE ASSIGNED 3. In another window, use Telnet as the client program by typing a command telnet localhost 25000 . This will test that the Server application is working 4. Now test using the C client by typing: prog2client 25000
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started