Revision 20
started moving ColonetServer into a class. the code is pretty messy at the moment
initialization.c | ||
---|---|---|
20 | 20 |
#include "includes/Logging.h" |
21 | 21 |
|
22 | 22 |
extern int listenSocket; |
23 |
extern Log * logger; |
|
24 | 23 |
|
25 |
int initializeServer(int argc, char** argv) |
|
26 |
{ |
|
27 |
printf("Initializing Server...\n"); |
|
28 |
|
|
29 |
parseCmdLine(argc, argv); |
|
30 |
|
|
31 |
//TODO: make it so the log file name is passed in on command line and default it to something if it isn't |
|
32 |
logger = new Log("logFile.txt"); |
|
33 |
|
|
34 |
if (initConnection(optionsG.listen_port) < 0) |
|
35 |
return -1; |
|
36 |
|
|
37 |
if (initWireless() < 0) { |
|
38 |
fprintf(stderr, "%s: initWireless failed\n", __FUNCTION__); |
|
39 |
return -1; |
|
40 |
} |
|
41 |
|
|
42 |
return 0; |
|
43 |
} |
|
44 |
|
|
45 | 24 |
/* |
46 | 25 |
int parseCommandLine(int argc, char * argv[], commandParams_t * params) |
47 | 26 |
{ |
Also available in: Unified diff