Update JsonAPI.mq5

This commit is contained in:
Nikolai
2020-02-12 20:41:03 +03:00
committed by GitHub
parent aee89843da
commit 598253cfc3
+10 -9
View File
@@ -98,22 +98,23 @@ int OnInit(){
EventSetMillisecondTimer(1); EventSetMillisecondTimer(1);
int bindSocketsDelay = 65; // Seconds to wait if binding of sockets fails. int bindSocketsDelay = 65; // Seconds to wait if binding of sockets fails.
int bindAttemtps = 3; // Number of binding attemtps
bool result = false; bool result = false;
Print("Binding sockets..."); Print("Binding sockets...");
for(int i=0;i<bindAttemtps;i++){
result = BindSockets(); result = BindSockets();
if (BindSockets()) return(INIT_SUCCEEDED); if (result==false){
else { // Print("Binding of sockets failed permanently.");
Print("Binding sockets failed. Waiting ", bindSocketsDelay, " seconds to try again..."); Print("Binding sockets failed. Waiting ", bindSocketsDelay, " seconds to try again...");
Sleep(bindSocketsDelay*1000); Sleep(bindSocketsDelay*1000);
} result = BindSockets();
} if (result==false){
}
Print("Binding of sockets failed permanently."); Print("Binding of sockets failed permanently.");
return(INIT_FAILED); return(INIT_FAILED);
}
}
}
return(INIT_SUCCEEDED);
} }
/* /*