What to do
1) Implement Sliding windows - Part 2
- In Phase 1, I've mentioned that when using named pipe, basic flow control is achieved. At this point of the project, you need to replace named pipe with normal pipe, and use select() to listen to the reading end of the pipes (select() does not work on named pipes). There were four named pipes, which are pipeAPPtoDLL and pipeDLLtoAPP at both client and server. We will keep the name of the named pipes and replace them with normal pipes. After the replacement, the totally number of pipes will still be four. That's because pipes are unidirectional. (On some systems (but not Linux), pipes are bidirectional: data can be transmitted in both directions between the pipe ends. According to POSIX.1-2001, pipes only need to be unidirectional. Portable applications should avoid reliance on bidirectional pipe semantics. Find the code snippet select_on_pipe.c in my google drive folder)
Structure Graph
Phase 6 Goal
Based on the code of phase 5, replace the four named pipes between Datalink Layer and Application Layer at both client and server with normal pipes. Then implement the function select() on the reading end of each pipe. The use of select() guarantees that the receiving process will read the packet from the sending process only when the pipe is ready for reading, thus keeping the receiving process from reading undesired number of bytes.
No comments:
Post a Comment