-
Notifications
You must be signed in to change notification settings - Fork 0
/
Project4.cpp
43 lines (34 loc) · 867 Bytes
/
Project4.cpp
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
39
40
41
42
43
/***********************************************************
Devin Nemec
Networking - Fall 2016
TCP State Diagram Program
Purpose:
Example to show how server/clients manage states with TCP.
Written in C++
Input:
This program accepts input via the command line interface.
Output:
Current TCP state based on input
***********************************************************/
#include "states.hpp"
#include <iostream>
#include <string>
using namespace std;
int main () {
// Variables
string inputString = "";
State computer;
// Code
while (true) {
// Print Prompt to receive state
cout << "Choice : ";
getline (cin, inputString);
cout << "\n";
if (inputString.compare("quit") == 0) {
cout << "Quiting!\n";
return 0;
}
// Receive State
computer.receiveMessage(inputString);
}
}