Discussion of article "Working with sockets in MQL, or How to become a signal provider" - page 5
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I got such a synchronous TCP client:
I don't need a server on µl, so just a client. Tested superficially.
ZЫЫ: Thanks for the article.At the compilation stage, it fails on structure conversions :-(.
'cannnot cast Data_cz_char -> Data_cz_int ' and vice versa.
Though it seemed to work before. It seems to have stopped working after another terminal update.
What is the problem? I don't understand it.
What's the problem? I don't get it.
union
Thank you for your reply. However, the question is still relevant. MQL4 does not support unions. At least the doc says so.
Also, as I was investigating, some more questions arose:
- In the procedures send and recv the int flags parameter (the last one) is not covered in any way. In my case with send it takes value - 0, and in recv - 8, why?
- The original post says that the client is synchronous, but the example implements only sending a string to the server. What about the response ... .
Pardon me for my dummies questions. I'm trying to figure it out, but I'm not getting it yet ... if you can help me please.
I want to implement a working class for interaction with a third-party server of many clients. I am still stuck, alas.
Thanks for the reply. However, the question is still relevant. MQL4 does not support unions. At least the doc says so.
Also, as I was investigating, some more questions arose:
- In the procedures send and recv the int flags parameter (the last one) is not covered in any way. In my case with send it takes value - 0, and in recv - 8, why?
- The original post says that the client is synchronous, but the example implements only sending a string to the server. What about the response ... .
Pardon me for my dummies questions. I'm trying to figure it out, but I'm not getting it yet ... if you can help me please.
I want to implement a working class for interaction with a third-party server of many clients. I am still stuck, alas.
Forum on trading, automated trading systems and testing trading strategies
Code breaking changes in MQL4 language
Alain Verleyen, 2017.05.18 22:10
They introduced union (not documented on MT4, but works well with ME 1599) :
union Udata_32bytes { uchar d_uchar[32]; ulong d_ulong[4]; } data; void OnStart() { data.d_ulong[0]=0xFFEEDDCC; printf("uchar[%i] = %X",1,data.d_uchar[1]); }YES! Associations are working. THANK YOU!!! I understand that union support has been added as of 12th May 2017. Great!
It would be good for the developers to reflect this in the doc.
A simple example illustrating the work with union
- In the procedures send and recv, the int flags parameter (the last one) is not covered in any way. In the case of send it takes the value 0, but in recv it takes the value 8. Why?
Because you are making things up. I don't see flags =8.
- The original post says that the client is synchronous, and the example only implements sending a string to the server. What about the response ... .
Because you're making it up. I don't see any flags =8
With such formulations of questions it is better to address here.Dear GURU! I'm not in the habit of making things up. My mistake, apparently, was that the questions were addressed to the user with the nickname pavlick_ and concerned the TCP_Client class implemented by him and presented in this thread above - https://www.mql5.com/ru/forum/91150/page3#comment_2798881.
So I apologise for the disturbance. However, I did not expect such a stormy, if not to say more, reaction from you.
Believe me, sometimes it is useful to restrain your negative emotions.
Ditto! Ditto question!
New article Working with sockets in MQL, or How to become a signal provider has been published:
Author: o_O
Hi, This code works on MQL4 ?
I'm trying to port it to mql4, and when the DLL bind() function is called at MQL StartServer function, gives me the message below:
Hi, This code works on MQL4 ?
source was compiled for x64
you need change all pointer to 32 bit
f.e. use SOCKET32 instead SOCKET64 etc