-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchord.cpp
More file actions
executable file
·44 lines (30 loc) · 885 Bytes
/
chord.cpp
File metadata and controls
executable file
·44 lines (30 loc) · 885 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
// This autogenerated skeleton file illustrates how to build a server.
// You should copy it to another filename to avoid overwriting it.
#include "MyService.h"
#include <protocol/TBinaryProtocol.h>
#include <server/TSimpleServer.h>
#include <transport/TServerSocket.h>
#include <transport/TBufferTransports.h>
#include <listener.h>
#define INTRO_PORT 8000 //Randomly chosen port for introducer
using boost::shared_ptr;
using namespace ::mp2;
int main(int argc, char* argv[]){
if (argc<2){
printf("Please enter value of m\n");
exit(1);
}
pid_t pid = fork(); //creating introducer/listener
if(pid==0)
{
//Execute listener
printf("Executing listener...\n");
listener(m);
}
else
{
//Execute introducer
printf("Executing introducer...\n");
introducer(argv[1]);
}
}