forked from dheerajgoud728/chord_p2p
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchord.cpp
41 lines (36 loc) · 842 Bytes
/
chord.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
//============================================================================
// Name : chord.cpp
// Author : Dheeraj
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include "includes.h"
#include "defs.h"
#include "udp_listen.h"
#include "udp_send.h"
int c_wait = 0;
int m_wait = 0;
vector<cond_wait> waiting_list;
vector<int> rets;
int number = 1;
int main(int argc, char ** argv)
{
string inp;
cout<<"Enter ip:"<<endl;
string ip;
cin>>ip;
call_listen();
while(1){
cin>>inp;
if(inp == "GTID"){
string ret;
ret = get_reply(ip, "GTID");
ret = "Got Reply:" + ret;
cout<<ret<<endl;
}
else
call_send_to(ip, inp);
}
return 0;
}