Update JsonAPI.mq5
This commit is contained in:
+10
-9
@@ -98,23 +98,24 @@ 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);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
void OnTick(){
|
void OnTick(){
|
||||||
|
|||||||
Reference in New Issue
Block a user