Listen to socket port

 

Hell community,

do you know of a non time consuming way for listening to a socket port on every tick?

I know there is the possibility to do it the other way round: MT5 is the client and the DLL is the server, see: https://www.mql5.com/en/code/169

But how about sending messages to the MT5 client?

Does anybody have a thin solution to this?

Thanks in advance :-)

Working with sockets in MQL5
  • votes: 11
  • 2010.08.16
  • Andrey Voytenko | English Russian Spanish Portuguese
  • www.mql5.com
This library will allow you to tranfser realtime quotes from MetaTrader 5 to external server application.
 
juxeii:

Hell community,

do you know of a non time consuming way for listening to a socket port on every tick?

I know there is the possibility to do it the other way round: MT5 is the client and the DLL is the server, see: https://www.mql5.com/en/code/169

But how about sending messages to the MT5 client?

Does anybody have a thin solution to this?

Thanks in advance :-)


What are you trying to achive? Can you be more specific?


I assume that you need to "listen" a tcpip socket.


 
psousa:


What are you trying to achive? Can you be more specific?


I assume that you need to "listen" a tcpip socket.


Yes, exactly.

Is there a way for emulating a thread for the socket communication?

And another general question I have:

In this https://www.mql5.com/en/docs/basis/preprosessor/import there is the following statement:

Classes, string arrays or complex objects that contain strings and/or dynamic arrays of any types cannot be passed as a parameter to functions imported from DLL.

Does this mean that one cannot pass a class reference to a DLL or does it mean that one cannot pass a class reference that contains strings/dyn. arrays???

I would guess that it is generally not possible to pass a class reference, since this would allow the programmer to call member functions on an EA even if the EA thread is currently not running.

Is this true?

Thanks :-)

Documentation on MQL5: Language Basics / Preprocessor / Importing Functions (#import)
  • www.mql5.com
Language Basics / Preprocessor / Importing Functions (#import) - Documentation on MQL5
Reason: