Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I WASNT ABLE TO UPLOAD THE FILE After this, please download example socket program (socket_program.tar.gz) in the BlackBoard website. Please upload socket_program.tar.gz to a linux

I WASNT ABLE TO UPLOAD THE FILE

After this, please download example socket program (socket_program.tar.gz) in the BlackBoard website. Please upload socket_program.tar.gz to a linux machine, then run:

1. gunzip socket_program.tar.gz

2. tar xvf socket_program.tar

you will obtain the list of socket programs. Please refer to video Socket Demo to see how to use these socket programs. In these socket programs, there are client.c and server.c. Please compile and run these two programs and make them work. Please

a. Explain the basic functionality of server.c and client.c

b. Run server and client.

c. Turn in a screenshot to show how you run them

Please i need help with the question below

Modify the client.c and server.c program from Assignment 1 to add the following function: when the client connects to the server, the client provides the name ofa directory D to be retrieved in the server;

When the server receives the request, the server reads the name of the directory D, retrieves the contents from the directory D, and sends the contents back to the client. The client, after receiving the contents from the server, prints out the content.

Hint: 1. Use opendir() to open a directory; use man opendir to check more details;

2. Use readdir() to read contents under a directory: use man 3 readdir to check moredetails

3. Use closedir() to close a directory

Thanks

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions