socket interconnection skeleton

This commit is contained in:
Sergey Popov 2012-03-23 14:06:39 +04:00
parent 51c8931cbd
commit 7feb436240
4 changed files with 22 additions and 2 deletions

View File

@ -1,9 +1,9 @@
include_HEADERS = $(top_srcdir)/yasnd.h
include_HEADERS = $(top_srcdir)/yasnd.h yasnd-sock.h
yasnd_LDADD = ${libconfuse_LIBS}
yasnd_LDADD += $(top_srcdir)/lib/libyasnd.la
sbin_PROGRAMS = yasnd
yasnd_SOURCES = yasnd.c yasnd-ipc.c
yasnd_SOURCES = yasnd.c yasnd-ipc.c yasnd-sock.c
yasnd_CPPFLAGS = -I$(top_srcdir)
distclean-local:

7
daemon/yasnd-sock.c Normal file
View File

@ -0,0 +1,7 @@
int sock_init()
{
}
void sock_close()
{
}

8
daemon/yasnd-sock.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef YASND_SOCK_H
#define YASND_SOCK_H
// External functions
extern int sock_init();
extern void sock_close();
#endif

View File

@ -9,6 +9,7 @@
#include "yasnd-gammu.h"
#include "yasnd-log.h"
#include "yasnd-lpt.h"
#include "yasnd-sock.h"
cfg_t *cfg; // pointer to configuration structure
char pidfile[]="/var/run/yasnd.pid"; // pidfile path
@ -154,6 +155,8 @@ void init()
gammu_init();
// initialize LPT control circuit
lpt_init();
// initialize server socket
sock_init();
}
void check_host(int num,host_decl* host)
@ -285,6 +288,8 @@ void signal_handler(int signum)
lpt_lock();
// close log decriptor
log_close();
// close server socket
sock_close();
//
exit(EXIT_SUCCESS);
}