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 21:00
Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year school. what is the expected total cost for one year at the local community college if kirk lives at home? what is the expected total cost for one year at the out-of-state school if kirk lives on campus?
Answers: 2
question
Computers and Technology, 23.06.2019 08:00
The managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an .
Answers: 3
question
Computers and Technology, 23.06.2019 18:20
What is wi-fi infrastructure? a metropolitan area network that uses radio signals to transmit and receive data a communications technology aimed at providing high-speed wireless data over metropolitan area networks a means by which portable devices can connect wirelessly to a local area network, using access points that send and receive data via radio waves includes the inner workings of a wi-fi service or utility, including the signal transmitters, towers, or poles and additional equipment required to send out a wi-fi signal
Answers: 2
question
Computers and Technology, 24.06.2019 01:30
How would you cite different books by the same author on the works cited page? moore, jack h. folk songs and ballads. salem: poetry press, 1999. print. moore, jack h. ballads in poetry – a critical review. dallas: garden books, 1962. print. moore, jack h. folk songs and ballads. salem: poetry press, 1999. print. –––. ballads in poetry – a critical review. dallas: garden books, 1962. print. moore, jack h. ballads in poetry – a critical review. dallas: garden books, 1962. print. moore, jack h. folk songs and ballads. salem: poetry press, 1999. print. moore, jack h. ballads in poetry – a critical review. dallas: garden books, 1962. print. –––. folk songs and ballads. salem: poetry press, 1999. print.
Answers: 2
You know the right answer?
C Programming Sockets
Low-level I/O in C
Processes and signalling
5 code blocks t...
Questions
question
Medicine, 20.01.2022 22:00
question
Mathematics, 20.01.2022 22:00
Questions on the website: 13722361