root / trunk / code / projects / colonet / ColonetServer / Main.cpp @ 453
History | View | Annotate | Download (686 Bytes)
1 | 391 | emarinel | #include <stdio.h> |
---|---|---|---|
2 | #include <ColonetServer.h> |
||
3 | |||
4 | ColonetServer colonet_server; |
||
5 | |||
6 | /**
|
||
7 | * @brief The main function of the server
|
||
8 | *
|
||
9 | * @param argc The number of command line arguments passed to the program
|
||
10 | * @param argv The command line arguments passed to the program
|
||
11 | *
|
||
12 | * @return 0 on success, negative error code on error
|
||
13 | */
|
||
14 | int main(int argc, char** argv) { |
||
15 | if (colonet_server.initialize_server(argc, argv) < 0) { |
||
16 | fprintf(stderr, "\nThere was an error initializing the server.\n");
|
||
17 | return -1; |
||
18 | } |
||
19 | |||
20 | if (colonet_server.start_listening() < 0) { |
||
21 | 397 | emarinel | fprintf(stderr, "ColonetServer.start_listening failed.\n");
|
22 | 391 | emarinel | return -1; |
23 | } |
||
24 | |||
25 | colonet_server.run_server(); |
||
26 | |||
27 | return 0; |
||
28 | } |