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 19:50
Write a car class having two private member variables called tank and speed. write public methods called pumpgas and gofast. the method pumpgas gets an integer for gas that must be pumped. that value needs to be added to tank (no more than 20 gallons). it must return the amount of gas that is purchased ($4 per gallon). the method gofast should increase the speed by 5 each time it is called.write a constructor for the above class that initialized both variables to zero.write a tostring to display both the tank and speed when the car is printed.modify the car class to implement the interface comparable and an interface called carinter having the public methods in carinter.write the main program to create an array of size 5 of type car. create 5 car objects having each location of the array to refer to one of the cars. test the pumpgas, gofast, equals method on the array items. write an enhanced loop to print all the car values (using a tostring written last time).write a generic method to find the minimum of four items. pass int, double, char, string and car objects to test this method.
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Who needs to approve a change before it is initiated? (select two.) -change board -client or end user -ceo -personnel manager -project manager
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
You are consulting for a beverage distributor who is interested in determining the benefits it could achieve from implementing new information systems. what will you advise as the first step?
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
Sports and entertainment class, your goal is to increase attendance and make a profit for a game by getting your team on a winning track with total salaries less than $3,000,000
Answers: 3
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: 13722362