+LOCAL VOID Check_Connections( VOID )
+{
+ /* Pruefen, ob Verbindungen noch "alive" sind */
+
+ INT i;
+
+ for( i = 0; i < MAX_CONNECTIONS; i++ )
+ {
+ if( My_Connections[i].sock != NONE )
+ {
+ if( My_Connections[i].lastping > My_Connections[i].lastdata )
+ {
+ /* es wurde bereits ein PING gesendet */
+ if( My_Connections[i].lastping < time( NULL ) - Conf_PONG_Timeout )
+ {
+ /* Timeout */
+ Log( LOG_NOTICE, "Connection %d: Ping timeout." );
+ Conn_Close( i, "Ping timeout" );
+ }
+ }
+ else if( My_Connections[i].lastdata < time( NULL ) - Conf_PING_Timeout )
+ {
+ /* es muss ein PING gesendet werden */
+ Log( LOG_DEBUG, "Connection %d: sending PING ...", i );
+ My_Connections[i].lastping = time( NULL );
+ Conn_WriteStr( i, "PING :%s", This_Server->nick );
+ }
+ }
+ }
+} /* Conn_Check */
+
+