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];
|
char pRead[80];
|
||||||
int test,i;
|
int test,i;
|
||||||
SConnection *internalCon = NULL;
|
SConnection *internalCon = NULL;
|
||||||
|
int try;
|
||||||
|
|
||||||
|
try = 2;
|
||||||
|
tryagain:
|
||||||
|
try--;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
check for connection
|
check for connection
|
||||||
@ -201,9 +206,9 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
NETClosePort(connection);
|
NETClosePort(connection);
|
||||||
free(connection);
|
free(connection);
|
||||||
connection = NULL;
|
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);
|
ClearFixedStatus(eEager);
|
||||||
|
if (try > 0) goto tryagain;
|
||||||
|
SCWrite(pCon,"ERROR: Failed to contact main SICS server",eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -222,11 +227,10 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
NETClosePort(connection);
|
NETClosePort(connection);
|
||||||
free(connection);
|
free(connection);
|
||||||
connection = NULL;
|
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);
|
ClearFixedStatus(eEager);
|
||||||
pServ->simMode = 1;
|
pServ->simMode = 1;
|
||||||
|
if (try > 0) goto tryagain;
|
||||||
|
SCWrite(pCon,"ERROR: Failed to contact main SICS server",eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user