From e14b83e0233363c27d8c4c1d2d43f171fa290ab9 Mon Sep 17 00:00:00 2001 From: Nikolai Date: Thu, 13 Feb 2020 18:15:23 +0300 Subject: [PATCH] v 2.0 --- Experts/JsonAPI.mq5 | 51 ++++++++++++++++++++------------------------- README.md | 40 ++++++++++++++++++++++++++++------- 2 files changed, 56 insertions(+), 35 deletions(-) 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