diff freeDiameter/main.c @ 22:0b3b46da2c12

Progress on server code
author Sebastien Decugis <sdecugis@nict.go.jp>
date Mon, 19 Oct 2009 18:43:09 +0900
parents 277ec00d793e
children db6c40b8b307
line wrap: on
line diff
--- a/freeDiameter/main.c	Thu Oct 08 20:05:16 2009 +0900
+++ b/freeDiameter/main.c	Mon Oct 19 18:43:09 2009 +0900
@@ -50,6 +50,7 @@
 static struct fd_config conf;
 struct fd_config * fd_g_config = &conf;
 
+/* gcrypt functions to support posix threads */
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
 
 /* freeDiameter starting point */
@@ -104,6 +105,9 @@
 	/* Load the dynamic extensions */
 	CHECK_FCT(  fd_ext_load()  );
 	
+	/* Start the servers */
+	CHECK_FCT( fd_servers_start() );
+	
 	/* Start the peer state machines */
 	CHECK_FCT( fd_psm_start() );
 	
@@ -153,6 +157,7 @@
 	TRACE_DEBUG(INFO, FD_PROJECT_BINARY " daemon is stopping...");
 	
 	/* cleanups */
+	CHECK_FCT_DO( fd_servers_stop(), /* Stop accepting new connections */ );
 	TODO("Stop dispatch thread(s) properly (no cancel yet)");
 	CHECK_FCT_DO( fd_peer_fini(), /* Stop all connections */ );
 	TODO("Stop dispatch & routing threads");
"Welcome to our mercurial repository"