-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_peer_requester.cpp
43 lines (40 loc) · 1.37 KB
/
main_peer_requester.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
#include "Peer.h"
#include <list>
using namespace std;
int main()
{
string start;
cin>>start;
Peer peer(3);
cout<<"I am here"<<endl;
peer.setDS("127.0.0.1",88);
// cout<<peer.login("user1","pass1")<<endl;
string token1 = peer.signup("test3","123");
cout<<token1<<endl;
string token2 = peer.signup("test4","123");
cout<<token2<<endl;
string token3 = peer.signup("test5","123");
// peer.setTimeOut(2);
cout<<peer.getPortnIP(token2,"test3")<<endl;
cout<<peer.uploadImage(token1,"img1", "imggg1");
cout<<peer.uploadImage(token1,"img2", "imggg2");
cout<<peer.uploadImage(token1,"img3", "imggg3");
cout<<peer.uploadImage(token2,"img1", "imggg1");
cout<<peer.uploadImage(token2,"img2", "imggg2");
cout<<peer.uploadImage(token2,"img3", "imggg3");
cout<<peer.uploadImage(token3,"img1", "imggg1");
cout<<peer.uploadImage(token3,"img2", "imggg2");
cout<<peer.uploadImage(token3,"img3", "imggg3");
cin>>start;
cout<<peer.removeImage(token1, "img12")<<endl;
cout<<peer.removeImage(token2, "img23")<<endl;
cout<<peer.removeImage(token3, "img333")<<endl;
cin>>start;
peer.removeImage(token1, "img1");
peer.removeImage(token2, "img2");
peer.removeImage(token3, "img3");
cin>>start;
peer.removeImage(token3, "img2");
cin>>start;
cout<<peer.getAllImagesFromDS(token1)<<endl;
}