+
+ if( FD_ISSET( My_Connections[Idx].sock, &My_Connects ))
+ {
+ /* es soll nichts geschrieben werden, sondern ein
+ * connect() hat ein Ergebnis geliefert */
+
+ FD_CLR( My_Connections[Idx].sock, &My_Connects );
+
+ /* Ergebnis des connect() ermitteln */
+ len = sizeof( err );
+ res = getsockopt( My_Connections[Idx].sock, SOL_SOCKET, SO_ERROR, &err, &len );
+ assert( len == sizeof( err ));
+
+ /* Fehler aufgetreten? */
+ if(( res != 0 ) || ( err != 0 ))
+ {
+ /* Fehler! */
+ if( res != 0 ) Log( LOG_CRIT, "getsockopt (connection %d): %s!", Idx, strerror( errno ));
+ else Log( LOG_CRIT, "Can't connect socket to \"%s:%d\" (connection %d): %s!", My_Connections[Idx].host, Conf_Server[My_Connections[Idx].our_server].port, Idx, strerror( err ));
+
+ /* Socket etc. pp. aufraeumen */
+ FD_CLR( My_Connections[Idx].sock, &My_Sockets );
+ close( My_Connections[Idx].sock );
+ Init_Conn_Struct( Idx );
+
+ /* Bei Server-Verbindungen lasttry-Zeitpunkt auf "jetzt" setzen */
+ Conf_Server[My_Connections[Idx].our_server].lasttry = time( NULL );
+
+ return FALSE;
+ }
+ Log( LOG_DEBUG, "Connection %d with \"%s:%d\" established, now sendig PASS and SERVER ...", Idx, My_Connections[Idx].host, Conf_Server[My_Connections[Idx].our_server].port );
+
+ /* PASS und SERVER verschicken */
+ Conn_WriteStr( Idx, "PASS %s "PASSSERVERADD, Conf_Server[My_Connections[Idx].our_server].pwd );
+ Conn_WriteStr( Idx, "SERVER %s :%s", Conf_ServerName, Conf_ServerInfo );
+
+ return TRUE;
+ }
+