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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
Which of the following commands is more recommended while creating a bot?
Answers: 1
question
Computers and Technology, 24.06.2019 02:20
The first time a user launches the powerpoint program, which view is shown allowing the user to access recent presentations or create new presentations based on templates?
Answers: 1
question
Computers and Technology, 24.06.2019 03:40
4. does the kernel phenotype distribution support the idea that the cob is the result of a dihybrid cross? what information supports your answer? if a dihybrid cross (i.e. f1 to f2 of standard mendelian crosses) is not indicated what conditions might contribute to this finding.
Answers: 2
question
Computers and Technology, 24.06.2019 10:20
Multiple choice project create a program with two multiple choice questions. 1. users have two attempts only, show attempt number each time. hint: while loop with break control. (20%) 2. only one correct answer for each question, use switch case for each question. (20%) 3. show total score after the two questions are answered. hint: . (20%) 4. user have options to answer the two questions again if first attempt score is not 100%. hint: if statment. (20%) 5. use string method .toupper() to allow users to enter with lowercase or uppercase letters. (20%) 1. where is the capital of the state of florida? a. orlando b. tallahassee c. miami d. tampa b 2. where is walt disney world park located in florida? a. orlando b. tallahassee c. miami d. tampa a
Answers: 1
You know the right answer?
C Programming Sockets
Low-level I/O in C
Processes and signalling
5 code blocks t...
Questions
Questions on the website: 13722359