-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_serv.cpp
More file actions
36 lines (31 loc) · 734 Bytes
/
main_serv.cpp
File metadata and controls
36 lines (31 loc) · 734 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
#include <iostream>
#include <vector>
#include <iomanip>
#include <string>
#include "Flip.hpp"
#include "Serializable.hpp"
#include "Flip.hpp"
#include "SerialString.hpp"
#include "Client.hpp"
FLIP_APP(app);
FLIP_ROUTE(app, say_hello, flip::SerialString)
{
std::cout << pack.getData() << std::endl;
FLIP_RESPONSE(7, flip::SerialString, "OK");
}
FLIP_ROUTE(app, backToBack, flip::SerialString)
{
FLIP_RESPONSE(0, flip::SerialString, pack.getData());
}
FLIP_ROUTE(app, null, flip::SerialEmpty)
{
FLIP_RESPONSE(0, flip::SerialString, "NULL data ok");
}
int main(int ac, char **av) {
try {
app.run(4242);
} catch (std::exception &e) {
std::cout << e.what() << std::endl;
}
return 0;
}