forked from mckeemseattleu/CPSC5042CSServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
30 lines (24 loc) · 677 Bytes
/
main.cpp
File metadata and controls
30 lines (24 loc) · 677 Bytes
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
#include <cstdio>
#include "RPCServer.h"
int main(int argc, char const* argv[])
{
const char* serverIP = argv[1];
int port = atoi(argv[2]);
bool statusOk = true;
RPCServer* serverObj = new RPCServer(serverIP, port);
#if 0
std::vector<std::string> tokArray;
char buffer[128] = { "connect;mike;mike" };
serverObj->ParseTokens(buffer, tokArray);
#endif
// Print it out
statusOk = serverObj->StartServer();
printf("Endless loop, as server is up always");
while (statusOk)
{
statusOk = serverObj->ListenForClient();
statusOk = serverObj->ProcessRPC(); // Launch thread
}
delete serverObj;
return 0;
}