subject

C Programming Sockets
Low-level I/O in C
Processes and signalling
5 code blocks total in server_getFileByFirstLetter. c
Please finish the server of a client-server application. The client asks the user for a letter (a character in {A-Z, a-z}), and then sends that letter to the server. The server fork()s a child to handle the client, and that child process:
1. Gets the letter from the client
2. Attempts to open the current directory ("."). If it cannot open that directory then it:
-sends CANT_READ_DIR_CODE back to the client (in network endian),
-prints "Cannot read directory\n",
-returns.
3. Iterates thru the directory to looking for a file (not a directory or anything else) whose name starts with the letter obtained from the client.
4. If the server finds no matching file then it
-sends NO_MATCH_CODE back to the client (in network endian),
-prints "No matching file\n",
-returns.
5. Attempts to open the file for reading. If it cannot open the file then it:
-sends CANT_READ_FILE_CODE back to the client (in network endian),
-prints "Cannot read file \n",
-returns.
6. Prints "Sending , bytes\n"
7. Sends the size of the file as a uint32_t integer to the client (in network endian)
8. Sends the bytes of the file to the client. It should send the file in buffers of bytes of size BUFFER_LEN.
9. close()s what it should close.
Code: Complete the five your code here sections in server_getFileByFirstLetter. c program. Two additonal files are below for reference:

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 06:00, jack487
How can a user delete a drawing object
Answers: 1
image
Computers and Technology, 24.06.2019 04:30, littledudefromacross
Write and test a python program to find and print the largest number in a set of real (floating point) numbers. the program should first read a single positive integer number from the user, which will be how many numbers to read and search through. after reading in all of the numbers, the largest of the numbers input (not considering the count input) should be printed.
Answers: 1
image
Computers and Technology, 24.06.2019 13:30, nina288
What process should be followed while giving a reference? sam has given a reference of his previous manager in his resume. sam should him in advance that the potential employers will him.
Answers: 1
image
Computers and Technology, 25.06.2019 08:10, yangyang718
Rom also called main memory or system memoryis used to stor the essential parts of the operating while the computer is running / true or false
Answers: 2
You know the right answer?
C Programming Sockets
Low-level I/O in C
Processes and signalling
5 code blocks t...

Questions in other subjects:

Konu
Mathematics, 06.05.2020 18:05