Set timeouts for receiving and sending data for a socket system object.
[in] Data sending timeout in milliseconds.
[in] Data obtaining timeout in milliseconds.
Returns true if successful, otherwise false.
Do not confuse system object timeouts with the ones set when reading data via SocketRead. SocketTimeout sets timeouts once for a socket object in the operating system. These timeouts are to be applied to all functions for reading and sending data via this socket. In SocketRead, the timeout is set for a certain data reading operation.
The function can be called only from Expert Advisors and scripts, as they run in their own execution threads. If calling from an indicator, GetLastError() returns the error 4014 – "Function is not allowed for call".