Changeset 200

Show
Ignore:
Timestamp:
03/23/06 08:37:50 (2 years ago)
Author:
dsandler
Message:

During node connection, distinguish transient errors (e.g. bad bootstrap)
which result in the client retrying the join, and actual errors which halt the
join process for good. (Note that there are now three kinds of errors:
"retrying", "error", and "fatal" -- the latter will cause the application to
exit immediately. Maybe the fatal should be removed, and the exit behavior
pushed up to whatever program is observing the client's operation.)

Also fixed a bug: Once the client starts, the status should be RUNNING, not
STARTING!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedtree/trunk/src/net/feedtree/core/client/Client.java

    r189 r200  
    125125        public static final int STATUS_NOT_STARTED = 0; 
    126126        public static final int STATUS_STARTING = 1; 
     127        public static final int STATUS_RETRYING = 2; 
    127128        public static final int STATUS_RUNNING = 1000; 
    128129        public static final int STATUS_ERROR = -1; 
     
    343344                } catch (java.io.StreamCorruptedException exc) { 
    344345                    Logger.global.severe("Stream corruption error while finding bootstrap.  Sleeping and trying again."); 
    345                     status.notifyStatus(ClientStatus.STATUS_ERROR
     346                    status.notifyStatus(ClientStatus.STATUS_RETRYING
    346347                            "Network error; re-trying"); 
    347348 
     
    404405                            Logger.global.info("[Failed to bootstrap node into network after 60 sec.  Scrapping node and re-starting in 5-15 sec.]"); 
    405406 
    406                             status.notifyStatus(ClientStatus.STATUS_ERROR
     407                            status.notifyStatus(ClientStatus.STATUS_RETRYING
    407408                                    "Failed to connect; re-trying shortly"); 
    408409 
     
    425426        } 
    426427         
    427         status.notifyStatus(ClientStatus.STATUS_STARTING, 
     428        status.notifyStatus(ClientStatus.STATUS_RUNNING, 
    428429                "FeedTree client ready"); 
    429430