add a server main.cc
This commit is contained in:
parent
4bb7a8dab7
commit
f1c3d2c95b
@ -66,5 +66,4 @@ for lib_path in libs_to_copy:
|
|||||||
installed_libs = env_client.Install(BIN_DIR, lib_path)
|
installed_libs = env_client.Install(BIN_DIR, lib_path)
|
||||||
env_client.Depends('%s/%s' % (BIN_DIR, client_name), installed_libs)
|
env_client.Depends('%s/%s' % (BIN_DIR, client_name), installed_libs)
|
||||||
env_client.Program('%s/%s' % (BIN_DIR, client_name), sources_client)
|
env_client.Program('%s/%s' % (BIN_DIR, client_name), sources_client)
|
||||||
# turn this back on when we have any server sources present
|
env_server.Program('%s/%s' % (BIN_DIR, server_name), sources_server)
|
||||||
#env_server.Program('%s/%s' % (BIN_DIR, server_name), sources_server)
|
|
||||||
|
35
src/server/main.cc
Executable file
35
src/server/main.cc
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
|
||||||
|
#include <getopt.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
int port = 59243;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
static struct option long_options[] = {
|
||||||
|
{"port", required_argument, 0, 'p'},
|
||||||
|
{NULL, 0, 0, 0}
|
||||||
|
};
|
||||||
|
int opt_index = 0;
|
||||||
|
int c = getopt_long(argc, argv, "p:",
|
||||||
|
long_options, &opt_index);
|
||||||
|
if (c == -1)
|
||||||
|
break;
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case 'p':
|
||||||
|
port = atoi(optarg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TODO: make this work... */
|
||||||
|
#if 0
|
||||||
|
Server server(port);
|
||||||
|
|
||||||
|
server.run();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user