Update JsonAPI.mq5

This commit is contained in:
Nikolai
2020-02-12 20:41:03 +03:00
committed by GitHub
parent aee89843da
commit 598253cfc3
+13 -12
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...");
result = BindSockets();
for(int i=0;i<bindAttemtps;i++){ if (result==false){
result = BindSockets(); // Print("Binding of sockets failed permanently.");
if (BindSockets()) return(INIT_SUCCEEDED); Print("Binding sockets failed. Waiting ", bindSocketsDelay, " seconds to try again...");
else { Sleep(bindSocketsDelay*1000);
Print("Binding sockets failed. Waiting ", bindSocketsDelay, " seconds to try again..."); result = BindSockets();
Sleep(bindSocketsDelay*1000); if (result==false){
} Print("Binding of sockets failed permanently.");
return(INIT_FAILED);
} }
} }
Print("Binding of sockets failed permanently."); }
return(INIT_FAILED);
return(INIT_SUCCEEDED);
} }
/* /*