try to connect twice in order to avoid an error message when the main
SICS server has been restarted
This commit is contained in:
@ -168,6 +168,11 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
char pRead[80];
|
||||
int test,i;
|
||||
SConnection *internalCon = NULL;
|
||||
int try;
|
||||
|
||||
try = 2;
|
||||
tryagain:
|
||||
try--;
|
||||
|
||||
/*
|
||||
check for connection
|
||||
@ -201,9 +206,9 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
NETClosePort(connection);
|
||||
free(connection);
|
||||
connection = NULL;
|
||||
SCWrite(pCon,"ERROR: Failed to contact sync server",eError);
|
||||
SCWrite(pCon,"Try again in order to reconnect before giving up",eWarning);
|
||||
ClearFixedStatus(eEager);
|
||||
if (try > 0) goto tryagain;
|
||||
SCWrite(pCon,"ERROR: Failed to contact main SICS server",eError);
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
@ -222,11 +227,10 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
NETClosePort(connection);
|
||||
free(connection);
|
||||
connection = NULL;
|
||||
SCWrite(pCon,"ERROR: Failed to contact sync server",eError);
|
||||
SCWrite(pCon,
|
||||
"Try again in order to reconnect before giving up",eWarning);
|
||||
ClearFixedStatus(eEager);
|
||||
pServ->simMode = 1;
|
||||
if (try > 0) goto tryagain;
|
||||
SCWrite(pCon,"ERROR: Failed to contact main SICS server",eError);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user