Question: In this problem, you are required to write a program that simulates an asynchronous file transfer protocol consisting of two sequential programs: (1) a sender
In this problem, you are required to write a program that simulates an asynchronous file transfer protocol consisting of two sequential programs: (1) a sender and (2) a receiver. The sender will open the file to send (i.e., the input file) and the receiver will open the file to receive (i.e., the output file). The sender will have two queues: (1) an array containing data (i.e., data messages) that are ready to send to the receiver (call it the senders output queue), and (2) a linked list containing acknowledgements (i.e., ack messages) received from the receiver (call it the senders input queue). The receiver will also have two queues: (1) a linked list containing data messages received from the sender (call it the receivers input queue), and (2) an array containing ack messages that are ready to send to the sender (call it the receivers output queue). The queues should be defined as C++ classes. Your C++ classes should be implementations of the queue algorithms given on the CS210 Algorithms web page. Do not waste your time implementing any algorithms that you dont actually need.
The data and ack messages have the same format and should be described by a struct containing two members: (1) a message number defined as an int and (2) a single character of data defined as a char.
The sizes of the queues will be determined by the following four global constants: (1) SENDERS_OUTPUT_QUEUE_SIZE = 32, (2) SENDERS_INPUT_QUEUE_SIZE = 4, (3) RECEIVERS_INPUT_QUEUE_SIZE = 8, and (4) RECEIVERS_OUTPUT_QUEUE_SIZE = 16.
Put the queue class specifications and implementations in separate .h and .cpp files, respectively. Put the client program in separate .h and .cpp files.
Prior to processing any send and receive events, the simulator should output to the screen the current value of the global clock. For example,
Global Clock: 99
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
