Discussion of article "Working with sockets in MQL, or How to become a signal provider" - page 8

 

I found this solution for organising WebSocket in MT4 library. I have done everything as specified in the example, the indicator compiles normally, but an error appears when applying it.

Could you tell me what could be the reason for the error?

 
felixfix:

I found this solution for organising WebSocket in MT4 library. I did everything as specified in the example, the indicator compiles normally, but an error appears when applying it.

Can you tell me what can be the reason for the error?

The errors clearly indicate that the lws2mql.dll library is missing in the Libraries folder, so the lwsGetVersion method cannot be called.

 
felixfix:

I found this solution for organising WebSocket in MT4 library. I did everything as specified in the example, the indicator compiles normally, but an error appears when applying it.

Can you tell me what can be the reason for the error?

It's a shame. This library does not support x64 ((

 
How to change client signal code in order to run on account type Hedging mode on mt5....please help me 
 

Thanks for the detailed documentation, that definitely helped me quite a bit ;)

Nevertheless, the following casting does not seem to work in newer versions.

ref_sockaddr ref=(ref_sockaddr)addrin;

The workaround that worked for me was the following:

   //cast struct
   ref_sockaddr ref;
   ref.ref[0] = addrin.sin_family & 0xff;
   ref.ref[1] = addrin.sin_family >> 8;
   ref.ref[2] = addrin.sin_port & 0xff;
   ref.ref[3] = addrin.sin_port >> 8;
   for (int i=0; i < sizeof(ulong); i++) ref.ref[4+i] = (addrin.sin_addr >> (8*i)) & 0xff;
   res=connect(s, ref.ref, sizeof(addrin));

Cheers, Jan

 
Is there an MT4 version?
 
Can I organise two-way exchange using this library?
[Deleted]  
Andrii Djola:
Can I organise a two-way exchange using this library?

I don't see any obstacles, even three-way

 
Question: is there any way to get the client's IP address on the server side? If yes, how?
 
socketTest USDJPY.BA,H1: -Connect failed error: (#10047) Address family not supported by protocol family.


Connect error