[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/icecream/icecream/daemon
From:       Stephan Kulow <coolo () kde ! org>
Date:       2004-08-25 16:17:26
Message-ID: 20040825161726.7330316B53 () office ! kde ! org
[Download RAW message or body]

CVS commit by coolo: 

try some times more if bind fails - not forever though


  M +16 -8     main.cpp   1.97


--- kdenonbeta/icecream/icecream/daemon/main.cpp  #1.96:1.97
@@ -214,4 +214,6 @@ int setup_listen_fd()
     }
 
+    int count = 5;
+    while ( count ) {
     struct sockaddr_in myaddr;
     myaddr.sin_family = AF_INET;
@@ -221,5 +223,10 @@ int setup_listen_fd()
               sizeof (myaddr)) < 0) {
         perror ("bind()");
+            sleep( 2 );
+            if ( !--count )
         return -1;
+            continue;
+        } else
+            break;
     }
 
@@ -474,4 +481,5 @@ int main( int argc, char ** argv )
         if ( listen_fd > -1 ) {
             // as long as we have no scheduler, don't listen for clients
+            shutdown( listen_fd, SHUT_RDWR ); // Dirk's suggestion
             close( listen_fd );
             listen_fd = -1;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic