- neue Funktionen Conn_InitListeners() und Conn_ExitListeners().
This commit is contained in:
parent
03ec91f943
commit
a0c032b2ff
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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.h,v 1.21 2002/11/05 14:18:13 alex Exp $
|
||||
* $Id: conn.h,v 1.22 2002/11/22 17:58:19 alex Exp $
|
||||
*
|
||||
* conn.h: Verwaltung aller Netz-Verbindungen ("connections") (Header)
|
||||
*/
|
||||
|
@ -28,6 +28,9 @@ typedef INT CONN_ID;
|
|||
GLOBAL VOID Conn_Init PARAMS((VOID ));
|
||||
GLOBAL VOID Conn_Exit PARAMS(( VOID ));
|
||||
|
||||
GLOBAL INT Conn_InitListeners PARAMS(( VOID ));
|
||||
GLOBAL VOID Conn_ExitListeners PARAMS(( VOID ));
|
||||
|
||||
GLOBAL BOOLEAN Conn_NewListener PARAMS(( CONST UINT Port ));
|
||||
|
||||
GLOBAL VOID Conn_Handler PARAMS(( VOID ));
|
||||
|
|
Loading…
Reference in New Issue