Asynchronously react if something new arrives in the socket channel

 

Can a remote server send data to my Expert advisor throughout socket so the EA can react to it asynchronously? I mean, I want my EA working normally and do something only when some data is received in the socket channel.

I don´t believe it is possible because it seems to me it uses only one thread, but I am asking here to confirm the limitation. I cannot use DLL (it runs in a VPS). It needs to be blazing fast.

If it's not possible I will just handle it using a combination of the onTimer and the onTick event handlers. 

 
metadevEU:

Can a remote server send data to my Expert advisor throughout socket so the EA can react to it asynchronously? I mean, I want my EA working normally and do something only when some data is received in the socket channel.

I don´t believe it is possible because it seems to me it uses only one thread, but I am asking here to confirm the limitation. I cannot use DLL (it runs in a VPS). It needs to be blazing fast.

If it's not possible I will just handle it using a combination of the onTimer and the onTick event handlers. 

Only one thread.

So you need to integrate the socket check in your code. Either as timer event, or at the end of OnTick.

I would do both, just to make sure I have reasonable execution of my socket check.

Can be done.

Another option is to create a service, and have it notify your ea with the new data available, iE ChartEvents.
 
Got it. Thanks.