X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fconn.c;h=85a9966b9859283926d36603b374040ab793ca84;hb=c0e7a0124d03ff512fa1513c2459ce8165496896;hp=818be9d66e6a3531a06f583537728012e732af93;hpb=ffb90f4cb5a869712dc30032c5aa5efcdf83ffa8;p=ngircd-alex.git diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index 818be9d6..85a9966b 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: conn.c,v 1.92 2002/11/22 16:35:19 alex Exp $ + * $Id: conn.c,v 1.93 2002/11/22 17:58:19 alex Exp $ * * connect.h: Verwaltung aller Netz-Verbindungen ("connections") */ @@ -187,6 +187,43 @@ Conn_Exit( VOID ) } /* Conn_Exit */ +GLOBAL INT +Conn_InitListeners( VOID ) +{ + /* Ports, auf denen der Server Verbindungen entgegennehmen + * soll, initialisieren */ + + INT created, i; + + created = 0; + for( i = 0; i < Conf_ListenPorts_Count; i++ ) + { + if( Conn_NewListener( Conf_ListenPorts[i] )) created++; + else Log( LOG_ERR, "Can't listen on port %u!", Conf_ListenPorts[i] ); + } + return created; +} /* Conn_InitListeners */ + + +GLOBAL VOID +Conn_ExitListeners( VOID ) +{ + /* Alle "Listen-Sockets" schliessen */ + + INT i; + + Log( LOG_INFO, "Shutting down all listening sockets ..." ); + for( i = 0; i < Conn_MaxFD + 1; i++ ) + { + if( FD_ISSET( i, &My_Sockets ) && FD_ISSET( i, &My_Listeners )) + { + close( i ); + Log( LOG_DEBUG, "Listening socket %d closed.", i ); + } + } +} /* Conn_ExitListeners */ + + GLOBAL BOOLEAN Conn_NewListener( CONST UINT Port ) {