Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Adding the socket server
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberax committed Dec 14, 2011
1 parent 7d084fb commit f703fe4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ CONFIGURE_FILE(
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)

ADD_SUBDIRECTORY(libsofadb)
ADD_SUBDIRECTORY(server)
ADD_SUBDIRECTORY(example)
ADD_SUBDIRECTORY(test)
ADD_SUBDIRECTORY(tools)
15 changes: 15 additions & 0 deletions server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
PROJECT(sofa_server)

FILE(GLOB sofa_server_SRCS
server_main.cpp
)

FILE(GLOB sofa_server_INCLUDES
)

INCLUDE_DIRECTORIES(.)
INCLUDE_DIRECTORIES(${libsofadb_SOURCE_DIR})
INCLUDE_DIRECTORIES(${BOOST_INCLUDE_DIR})

ADD_EXECUTABLE(sofa_server ${sofa_server_SRCS} ${sofa_server_INCLUDES})
TARGET_LINK_LIBRARIES(sofa_server libsofadb ${Boost_LIBRARIES} glog gflags)
18 changes: 18 additions & 0 deletions server/server_main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "common.h"
#include <gflags/gflags.h>
#include <scope_guard.h>

DEFINE_string(socket_path, "~/.local/share/sofadb/=socket",
"Listen socket path");
DEFINE_int32(socket_backlog, 10, "Maximum socket backlog");

int main(int argc, char **argv)
{
ON_BLOCK_EXIT(&google::ShutDownCommandLineFlags);
google::SetUsageMessage("Usage");
google::SetVersionString("SofaDB Server 0.1");
google::ParseCommandLineFlags(&argc, &argv, true);

printf("Parsed\n");
return 0;
}

0 comments on commit f703fe4

Please sign in to comment.