-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetwork.h
More file actions
38 lines (30 loc) · 1.38 KB
/
Network.h
File metadata and controls
38 lines (30 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef NETWORK_H
#define NETWORK_H
#include <vector>
#include <iostream>
#include "Packet.h"
#include "Client.h"
using namespace std;
class Network {
public:
Network();
~Network();
// Executes commands given as a vector of strings while utilizing the remaining arguments.
void process_commands(vector<Client> &clients, vector<string> &commands, int message_limit, const string &sender_port,
const string &receiver_port);
// Initialize the network from the input files.
vector<Client> read_clients(string const &filename);
void read_routing_tables(vector<Client> & clients, string const &filename);
vector<string> read_commands(const string &filename);
//Added:
int numberOfClients, numOfCommands;
void newMessage(string senderId, string receiverId, string messageContent, int message_limit, std::string sender_port, std::string receiver_port,vector<Client> &clients);
void show_frame_info(string clientId,std::string queue_selection,int frame_number,vector<Client> &clients);
void show_q_info(string clientId,std::string queue_selection,vector<Client> &clients);
void send(vector<Client> &clients);
void receive(vector<Client> &clients);
void printLog(vector<Client> &clients, string client_ID);
std::string getTimestamp();
Packet* indexStack(std::stack<Packet*>& stack, int index) ;
};
#endif // NETWORK_H