changeset 126:b82a482f0ed8

Added some more comments
author Sebastien Decugis <sdecugis@nict.go.jp>
date Fri, 15 Aug 2008 17:52:26 +0900
parents 8aa829378790
children 6e655f5ae656
files waaad/peer-listener.c
diffstat 1 files changed, 32 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/waaad/peer-listener.c	Fri Aug 15 17:51:34 2008 +0900
+++ b/waaad/peer-listener.c	Fri Aug 15 17:52:26 2008 +0900
@@ -45,7 +45,23 @@
 #include "waaad-internal.h"
 #include "peer-internal.h"	
 
-/* The code of the thread waiting for incoming connection. There are two instances running, for TCP and for SCTP */
+/* The code of a receiver thread, to handle an incoming connection */
+void * _peer_receiver_th(void * arg)
+{
+	TRACE_ENTRY( "%p", arg );
+	
+	/* Wait for incoming message, until timeout */
+	
+	/* if message is not CER, disconnect */
+	
+	/* if CER, check we do not have already a peer with this diameter-id in the list */
+	
+	/* depending on the peer state, act as needed */
+	
+	TRACE_DEBUG (INFO, "@@@ %s: not implemented yet.", __FUNCTION__ );
+	return NULL;
+}
+/* The code of the thread waiting for incoming connection. 1 thread per listening socket. */
 void * _peer_listen_th(void * arg)
 {
 	int sock = 0;
@@ -54,11 +70,17 @@
 	
 	/* sock = *(int *)arg; */
 	
+	/* listen() */
+	
+	/* accept() */
+	
+	/* On new connection, create a receiver thread (_peer_receiver_th) */
+	
 	TRACE_DEBUG (INFO, "@@@ %s: not implemented yet.", __FUNCTION__ );
 	return NULL;
 }
 
-/* Code to open the TCP socket */
+/* Code to open a TCP socket */
 int _listen_tcp(int * sock)
 {
 	TRACE_ENTRY( "" );
@@ -66,11 +88,17 @@
 	return ENOTSUP;
 }
 	
-/* Code to open the SCTP socket */
+/* Code to open a SCTP socket */
 int _listen_sctp(int * sock)
 {
 	TRACE_ENTRY( "" );
 	TRACE_DEBUG (INFO, "@@@ %s: not implemented yet.", __FUNCTION__ );
 	return ENOTSUP;
 }
-	
+
+/* Code to start listening */
+/* -- must use these --
+	int		 disable_inet4;
+	int		 disable_inet6;
+	int		 disable_tcp;
+*/
"Welcome to our mercurial repository"