File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ /* *
2+ * The GoBackN class is defined, which includes the constructor to initialize the window size,
3+ * variables for tracking frames to send and frames expected, and functions for sender and receiver operations.
4+ **/
5+
6+
7+
8+ #include " GoBackN.h"
9+ #include < iostream>
10+ #include < cstdlib>
11+ #include < ctime>
12+
13+
14+ using namespace std ;
15+ const int MAX_SEQUENCE_NUM = 7 ;
16+
17+ // Constructor for GoBackN class
18+ GoBackN::GoBackN (int window_size) {
19+ WINDOW_SIZE = window_size;
20+ frame_to_send = 0 ;
21+ next_frame_to_send = 0 ;
22+ frame_expected = 0 ;
23+ }
24+
Original file line number Diff line number Diff line change 1+ // This code defines a class 'GoBackN' that represents the Go-Back-N protocol.
2+
3+
4+
5+ #ifndef GOBACKN_H
6+ #define GOBACKN_H
7+
8+
9+ class GoBackN {
10+ private:
11+ int WINDOW_SIZE;
12+ int frame_to_send;
13+ int next_frame_to_send;
14+ int frame_expected;
15+
16+ public:
17+ GoBackN (int window_size);
18+ };
19+
20+ #endif
You can’t perform that action at this time.
0 commit comments