-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
56 lines (49 loc) · 982 Bytes
/
Copy pathmain.cpp
File metadata and controls
56 lines (49 loc) · 982 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <thread>
#include "BackupSocket.h"
#include "RestoreSocket.h"
#include "Spiral.h"
#include "vdierror.h" // error constants
void printError(HRESULT code);
//
// main function
//
int main(int argc, char *argv[])
{
HRESULT h;
BackupSocket* b = new BackupSocket();
RestoreSocket* r = new RestoreSocket();
Spiral* s = new Spiral();
printError(b->Initialize());
printError(r->Initialize());
h = s->Initialize();
if(h > 0)
{
printf("Error initializing spiral");
return 1;
}
std::thread* backup = b->StartOperation("", "pubs");
std::thread* restore = r->StartOperation("", "pubs2");
if(b != NULL )//&& r != NULL)
{
printError(s->Transfer());
}
delete b, s;
int x;
std::cin >> x;
}
void printError(HRESULT code)
{
switch(code){
case 0:
printf("success\n");
break;
case VD_E_TIMEOUT:
printf("Connection timed out\n");
break;
default:
printf("Exit code: x%X\n", code);
break;
}
}