Revision 508
position updating in separate thread. incomplete SIGINT handler
Main.cpp | ||
---|---|---|
1 | 1 |
#include <stdio.h> |
2 |
#include <signal.h> |
|
2 | 3 |
#include <ColonetServer.h> |
3 | 4 |
|
4 | 5 |
ColonetServer colonet_server; |
5 | 6 |
|
7 |
void cleanup(int a) { |
|
8 |
printf("TODO deinit wireless here\n"); |
|
9 |
exit(0); |
|
10 |
} |
|
11 |
|
|
6 | 12 |
/** |
7 | 13 |
* @brief The main function of the server |
8 | 14 |
* |
... | ... | |
17 | 23 |
return -1; |
18 | 24 |
} |
19 | 25 |
|
26 |
signal(SIGINT, cleanup); |
|
27 |
|
|
20 | 28 |
if (colonet_server.start_listening() < 0) { |
21 | 29 |
fprintf(stderr, "ColonetServer.start_listening failed.\n"); |
22 | 30 |
return -1; |
23 | 31 |
} |
24 | 32 |
|
33 |
colonet_server.run_position_monitor(); |
|
34 |
|
|
25 | 35 |
colonet_server.run_server(); |
26 | 36 |
|
27 | 37 |
return 0; |
Also available in: Unified diff