Changeset 2238 for trunk/eraser


Ignore:
Timestamp:
8/4/2010 10:39:59 AM (4 years ago)
Author:
lowjoel
Message:

Be slightly more intelligent when connecting to a remote instance: connection via pipes should be instantaneous so have a timeout of 0. If we can't connect, Run will return immediately so that we won't have to keep waiting for Run to return and then we can initiate the new instance of Eraser.

Location:
trunk/eraser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.Manager/RemoteExecutor.cs

    r2030 r2238  
    336336            try 
    337337            { 
    338                 client.Connect(10000); 
     338                client.Connect(0); 
    339339            } 
    340340            catch (TimeoutException) 
  • trunk/eraser/Eraser/Program.cs

    r2236 r2238  
    284284                    eraserInstance.WaitForInputIdle(); 
    285285 
    286                     result.Run(); 
    287                     if (!result.IsConnected) 
    288                         throw new IOException(S._("Eraser cannot connect to the running " + 
    289                             "instance for erasures.")); 
     286                    //Wait for the server to be initialised. 
     287                    for (int i = 0; !result.IsConnected; ++i) 
     288                    { 
     289                        Thread.Sleep(100); 
     290                        result.Run(); 
     291 
     292                        //After 10s, we should probably give up. 
     293                        if (i > 100) 
     294                            throw new IOException(S._("Eraser cannot connect to the running " + 
     295                                "instance for erasures.")); 
     296                    } 
    290297                } 
    291298 
Note: See TracChangeset for help on using the changeset viewer.