gmag11 / MQTT-MQL5-Library

MQTT client library for MetaTrader 5
MIT License
3 stars 2 forks source link

Socket Timeout is not in seconds, but in milliseconds #2

Open shimatai opened 8 months ago

shimatai commented 8 months ago

https://github.com/gmag11/MQTT-MQL5-Library/blob/b281acf03adeb959111d4a38d6e20aa851af228e/PubSubClient.mqh#L64

I was facing a connection problem where connecting to a MQTT server in localhost was working fine, but when I tried to connect to a remote MQTT server, I was getting socket timeout. I discovered that the Socket Timeout parameter must be in milliseconds, so the default value should be 15000 and not 15.

So, connecting to a remote server it was taking more than 15 milliseconds, when I changed the socket timeout value to 15000 (15 seconds) it connectto immediately.

My suggestion is to change the default value to 15000.

gmag11 commented 8 months ago

Thank you. I'll check