]> git.mxchange.org Git - flightgear.git/commitdiff
Tweaks to parallel construction tools.
authorcurt <curt>
Mon, 17 May 1999 17:43:52 +0000 (17:43 +0000)
committercurt <curt>
Mon, 17 May 1999 17:43:52 +0000 (17:43 +0000)
Tools/Construct/Parallel/client.cxx
Tools/Construct/Parallel/server.cxx
Tools/Lib/Polygon/names.hxx

index fb4bc517e0fd4d058b43ecf7c7d6c86209e94b51..da429673d039bc0217b83617192f75daa2fb1c6f 100644 (file)
@@ -45,7 +45,7 @@ int make_socket (char *host, unsigned short int port) {
     {
        close(sock);
        perror("Cannot connect to stream socket");
-       exit(-1);
+       return -1;
     }
 
     return sock;
@@ -59,7 +59,10 @@ long int get_next_task( const string& host, int port ) {
     fd_set ready;
     char message[256];
 
-    sock = make_socket( host.c_str(), port );
+    while ( (sock = make_socket( host.c_str(), port )) < 0 ) {
+       // loop till we get a socket connection
+       sleep(1);
+    }
 
     // build a command string from the argv[]'s
     strcpy(message, "hello world!\n");
@@ -115,8 +118,10 @@ main(int argc, char *argv[]) {
     string host = argv[1];
     int port = atoi( argv[2] );
 
-    while ( true ) {
-       tile = get_next_task( host, port );
+    while ( 
+          (tile = get_next_task( host, port )) >= 0
+          )
+    {
        run_task( tile );
     }
 }
index 3cc05cdde27a5dc73ad876c6ab34aee15b66cc9b..05f74ee51cb9b135ed3aa1f11dcec7685c35555a 100644 (file)
@@ -160,7 +160,7 @@ long int get_next_tile( const string& work_base, const string& output_base )
     }
 
     b = FGBucket( lon, lat );
-    cout << "Bucket = " << b << endl;
+    cout << "Bucket = " << b << " (" << pass << ")" << endl;
 
     // increment to next tile
     FGBucket tmp( 0.0, lat );
@@ -203,7 +203,7 @@ int main( int argc, char **argv ) {
     cout << "socket is connected to port = " << port << endl;
 
     // Specify the maximum length of the connection queue
-    listen(sock, 3);
+    listen(sock, 10);
 
     for ( ;; ) {
        FD_ZERO(&ready);
@@ -217,7 +217,7 @@ int main( int argc, char **argv ) {
 
            // get the next tile to work on
            next_tile = get_next_tile(work_base, output_base);
-           cout << "next tile = " << next_tile << endl;;
+           // cout << "next tile = " << next_tile << endl;;
 
            msgsock = accept(sock, 0, 0);
            // cout << "msgsock = " << msgsock << endl;
index 52f3bb7adba1610c0e11eb23eb730ee6f94642e2..0b7f96bea238527dd69a515e8aa4125b925ea52d 100644 (file)
@@ -39,17 +39,17 @@ enum AreaType {
     SomeSortOfArea    = 0,
     AirportKeepArea   = 1,
     AirportIgnoreArea = 2,
-    OceanArea         = 3,
-    LakeArea          = 4,
-    DryLakeArea       = 5,
-    IntLakeArea       = 6,
-    ReservoirArea     = 7,
-    IntReservoirArea  = 8,
-    StreamArea        = 9,
-    CanalArea         = 10,
-    GlacierArea       = 11,
-    MarshArea         = 12,
-    DefaultArea       = 13,
+    LakeArea          = 3,
+    DryLakeArea       = 4,
+    IntLakeArea       = 5,
+    ReservoirArea     = 6,
+    IntReservoirArea  = 7,
+    StreamArea        = 8,
+    CanalArea         = 9,
+    GlacierArea       = 10,
+    MarshArea         = 11,
+    DefaultArea       = 12,
+    OceanArea         = 13,
     VoidArea          = 9997,
     NullArea          = 9998,
     UnknownArea       = 9999