diff --git a/Experts/JsonAPI.mq5 b/Experts/JsonAPI.mq5 index 8afcbd7..037bcb0 100644 --- a/Experts/JsonAPI.mq5 +++ b/Experts/JsonAPI.mq5 @@ -98,20 +98,20 @@ int OnInit(){ EventSetMillisecondTimer(1); int bindSocketsDelay = 65; // Seconds to wait if binding of sockets fails. - - bool result = false; + int bindAttemtps = 2; // Number of binding attemtps + Print("Binding sockets..."); - result = BindSockets(); - if (result==false){ - // Print("Binding of sockets failed permanently."); - Print("Binding sockets failed. Waiting ", bindSocketsDelay, " seconds to try again..."); - Sleep(bindSocketsDelay*1000); - result = BindSockets(); - if (result==false){ - Print("Binding of sockets failed permanently."); - return(INIT_FAILED); - } + + for(int i=0;i