Mercurial > nomad > old-fuse
changeset 90:3f9de434a526
client: use connsvc to listen on a socket
When we get the callback, we don't do much - we just close the socket.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Sat, 17 Oct 2015 10:07:33 -0400 |
parents | 8d52fe0c4baa |
children | b205e91043c0 |
files | src/client/CMakeLists.txt src/client/main.c |
diffstat | 2 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/client/CMakeLists.txt Sat Oct 17 10:06:05 2015 -0400 +++ b/src/client/CMakeLists.txt Sat Oct 17 10:07:33 2015 -0400 @@ -26,6 +26,7 @@ target_link_libraries(nomad-client ${BASE_LIBS} + ${TASKQ_LIBRARY} common nomad_objstore )
--- a/src/client/main.c Sat Oct 17 10:06:05 2015 -0400 +++ b/src/client/main.c Sat Oct 17 10:07:33 2015 -0400 @@ -22,9 +22,20 @@ #include <stdio.h> #include <stdlib.h> +#include <unistd.h> #include <nomad/types.h> #include <nomad/objstore.h> +#include <nomad/connsvc.h> + +#define CLIENT_DAEMON_PORT 2323 + +static void process_connection(int fd, void *arg) +{ + printf("%s: fd = %d, arg = %p\n", __func__, fd, arg); + + close(fd); +} int main(int argc, char **argv) { @@ -46,6 +57,10 @@ fprintf(stderr, "store = %p\n", store); + ret = connsvc(NULL, CLIENT_DAEMON_PORT, process_connection, store); + + fprintf(stderr, "connsvc() = %d\n", ret); + abort(); return 0;