Read data from secure TLS connection.
[in] Number of bytes to read to the buffer array. Data not fitting into the array remain in the socket. They can be received by the next SocketTLSRead call. buffer_maxlen cannot exceed INT_MAX (2147483647).
If successful, return the number of read bytes. In case of an error, -1 is returned.
If an error occurs on a system socket when executing the function, connection established via SocketConnect is discontinued.
The function is executed till it receives the specified amount of data or the timeout is reached (SocketTimeouts).
In case of a data reading error, the error 5273 (ERR_NETSOCKET_IO_ERROR) is written in _LastError.
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".