Websocket how? - page 27

 
Aleksei Beliakov:

1. You don't have that many jobs. I understand. Don't worry.

2. The logical conclusion would be to post the result (of all the work and mql4 too) here for everyone , it would raise the overall level of the forum, and maybe there would be more people with work and fewer people telling strangers what to do.

The issue has yet to be resolved, but the real issue is how to do it.

 
Aleksei Beliakov:

1. You don't have that many jobs. I understand. Don't worry.

2. The logical conclusion would be to post the results (of all mql4 work too) here for everyone , it would raise forum users' level on the whole, and maybe there would be more people with jobs and fewer people telling strangers what to do.

I support you, followed the issue in the same breath. for me as an illiterate self-student it was interesting to see step by step each action, especially with explanations. and here at the end after the discrepancies started a mess, in the end everything was corrected and done but without the detailed steps that and how. so it turns out that the self-study began to repeat / understand and at the time of inconsistencies remained in the free float without understanding what to do next. I agree that you can search through half of the internet to complete it on your own, but since it was such a great start, why not finish it in the same way. it is not the code itself that is needed, but just a competent explanation of how to bring it to a logical end.

 

Hello

Is this project freely available or is it a paid project? Is there a manual anywhere on how to implement it yourself?

I am interested in importing quotes in real time from another supplier through a websocket.


If we do everything by picture, I don't understand the process of quotations import and output. I don't think this question has been covered

 

I just wanted to start this topic. I have asked a question about C# and I haven't found it. Maybe someone will come along and help me ;)


The bottom line: I wrapped MQL5 library in C# natively to call it from MQL4, everything works,

But it works only once - before EA unloading, the second run in MT4 will cause an error

Unhandled exception 0xE0434352

search through the forum only herehttps://www.mql5.com/ru/forum/35807

the situation is confusing, that closing chart and opening chart drop EA does not solve the problem, only reloading MT4 helps

I close all the threads in .dll, but on unloading in task manager the process (which appears when dll is called) is closed


I have no idea where to look for it, in MQL5 it works like clockwork.

 
Igor Makanu:

I just wanted to start this topic. I have asked a question about C# and I haven't found it. Maybe someone will come along and help me ;)


The bottom line: I wrapped MQL5 library in C# natively to call it from MQL4, everything works,

But it works only once - before EA unloading, the second run in MT4 will cause an error

search through the forum only herehttps://www.mql5.com/ru/forum/35807

the situation is confusing, that closing chart and opening chart drop EA does not solve the problem, only reloading MT4 helps

I close all the threads in .dll, but on unloading in task manager the process (which appears when dll is called) is closed


I have no idea where to look for it, in MQL5 it works like clockwork.


An exception seems to be raised, add try-catch to the code
 
Fedor Arkhipov:


There must be an exception, add try-catch to the code

The problem is in MQL4 , my code is 99% the same

maybe the Robert Giesecke template I'm using to make native calls cannot handle it, or maybe the terminal is leaving some resources open

i dont know where to start looking (

 
Igor Makanu:

The problem is in MQL4 , my code is 99% the same

maybe the Robert Giesecke template I'm using to make native calls cannot handle it, or maybe the terminal is leaving some resources open

i don't know where to start looking for it ((

not all DLLs are reentrant. The term isn't quite right, but in a nutshell - after load-unload, the next load will cause undefined behavior.

Change something in process memory or a specific thread. DLL's are generally adaptable - load and go, no need to scroll back and forth :-)

but of course there are workarounds, you can prevent DLL offloading, if it is needed once, then let it stay in memory

with a link to the source, one of the recipes:

/* ----------------------------------------------------- */
/* предотвратить выгрузку DLL из памяти !! (без этого глючит)
/* copy-paste из https://blogs.msmvps.com/vandooren/2006/10/09/preventing-a-dll-from-being-unloaded-by-the-app-that-uses-it/
/* ----------------------------------------------------- */
HMODULE g_Self;
int LockLibraryIntoProcessMem(

HMODULE DllHandle,

HMODULE *LocalDllHandle)

{

  if(NULL == LocalDllHandle)

    return ERROR_INVALID_PARAMETER;

 

  *LocalDllHandle = NULL;

  TCHAR moduleName[1024];

  if(0 == GetModuleFileName(

DllHandle,

moduleName,

sizeof(moduleName)/ sizeof(TCHAR)))

    return GetLastError();

  *LocalDllHandle = LoadLibrary(moduleName);

  if(NULL == *LocalDllHandle)

    return GetLastError();

  return NO_ERROR;

}
BOOL APIENTRY DllMain( HMODULE hModule,
                      DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                               )
{

  switch(ul_reason_for_call)

  {

  case DLL_PROCESS_ATTACH:
        //      WriteLog("Attach");
    LockLibraryIntoProcessMem(hModule, &g_Self);

    break;

  case DLL_PROCESS_DETACH:
        //      WriteLog("Detach");

    break;

  }

    return TRUE;

}

something about formatting "killed" :-(

 
Maxim Kuznetsov:

upload it and go, nothing to scroll back and forth :-)

i have no particular choice, i'll stop in search of perfection, and i've got a strong desire to have everything working in 5 and in 4 without bugs, and not to rewrite the code from scratch ))))

thanks for the information, it is informative!

 

It seems like a long time ago... It seems...

Unloading dynamic loading library programs requires special skills. In MQL5 and MQl4 only Metaquotes have this skill, as only they have access to the secrets of job management language in their environment. And in JCL I would have made it on my knees.

 
Renat Fatkhullin #:

We put half of our own HTTP/HTTPS/TLS engine into SocketXXXX functions.

Perhaps we'll add CSocketWeb class with HTTP/HTTPS/WSS functionality to the standard library, so that we can control 100% of network operations from MQL5.

Hi @Renat Fatkhullin,

It's been over 2 years later, i'm sure development can be a milestone thing, but is this that hard to achieve?