Discussion of article "DIY multi-threaded asynchronous MQL5 WebRequest" - page 7

 

The file in the example multiwebclient sends only once when clicking on the chart. in case of several clicks the request to the http server is not sent. (I will dig into your sources) Perhaps it is necessary to pre-create not in INIT but each time to create on CLICK on the chart.

I thought that the object is deleted after closing the chart or closing the terminal.

Do you have an example to send a json message? Also it is not superfluous for someone to have a check for closing charts.

JSON SOFTWARE

For example, create a json class and fill it with setters. Adding arrays, adding elements, data types (its not simple).

And an example, a working EA, so that you can make sending from your function, for example, when a new bar appears, a JSON request is sent.

Many people would find it useful.

 
Sergei Poliukhov closing the terminal.

Do you have an example to send a json message? Also it is not superfluous for someone to have a check for closing charts.

JSON SOFTWARE

For example, create a json class and fill it with setters. Adding arrays, adding elements, data types (its not simple).

And an example, a direct working advisor, so that you can make sending from your function, for example, when a new bar appears, a JSON request is sent.

Many people would find it useful.

All 100% worked as described, at the time of writing the article, i.e. on click 3 requests were sent in parallel to the default 3 servers. You need settings and logs to find problems. Chart closures are processed and a notification is sent to the manager - look at the code.

void OnDeinit(const int reason)
{
  if(manager)
  {
    Print("WebRequest Pool Manager closed, ", ChartID());
    for(int i = 0; i < pool.size(); i++)
    {
      if(CheckPointer(pool[i]) == POINTER_DYNAMIC)
      {
        // let workers know they are not needed anymore
        EventChartCustom(pool[i].getChartID(), TO_MSG(MSG_DEINIT), ChartID(), 0.0, NULL);
      }
    }
    GlobalVariableDel(GVTEMP);
  }
  else
  {
    Print("WebRequest Worker closed, ", ChartID());
    // let know the manager that this worker is not available anymore
    EventChartCustom(ManagerChartID, TO_MSG(MSG_DEINIT), ChartID(), 0.0, NULL);
    ObjectDelete(0, OBJ_LABEL_NAME);
    ChartClose(0);
  }
  Comment("");
}

After the article was released, an improved version of launching via chart objects was posted in the discussion.

There are a lot of materials on json on the site, but I have not published my work on "pure" json and I don't have time to do it now.

Обсуждение статьи "Многопоточный асинхронный WebRequest на MQL5 своими руками" - Запустите WebRequest с помощью объектов-графиков, в которых применяется шаблон с экспертом-помощником.
Обсуждение статьи "Многопоточный асинхронный WebRequest на MQL5 своими руками" - Запустите WebRequest с помощью объектов-графиков, в которых применяется шаблон с экспертом-помощником.
  • 2018.11.12
  • Реter Konow
  • www.mql5.com
потому что не получается передать в них параметр при запуске - похоже. по аналогии с экспертами - похоже на счастливый случай. Выкладываю альтернативный вариант запуска веб-запросов - с помощью объектов-графиков