SSL_CLIENT_READ Function
Reads a BYTE array from a connection with an SSL-enabled HTTP server. A call to SSL_CLIENT_READ usually results in a number of separate reads from the connection.
Usage
nbytes = SSL_CLIENT_READ(connection, data)
Input Parameters
connection—An SSL_BIO_CTX structure containing the connection information returned by
SSL_CLIENT_CONNECT Function.
data—A PV-WAVE BYTE array large enough to hold the expected output from the server.
Returned Value
nbytes—The number of bytes read from the connection stream.
Keywords
None.
Discussion
Bytes are read from the connection until the server indicates that it is finished or the BYTE array is full. If the BYTE array fills up before the server is finished, a warning message is issued. It is best to use a BYTE array that is larger than the expected output.
The server writes the output data to the connection as a series of strings separated by carriage return and/or new-line characters. The returned BYTE array should be converted to a PV-WAVE STRING and split into sub-strings using the
STRSPLIT Function. Converting the BYTE array to a string and splitting the string on the hexadecimal value for the carriage return character (
'\x0D') reverts the returned data back to the lines of output sent by the server for easy parsing.
Example
For more information and to see this process in use, see the file ssl_demo.pro in the SSL_connect lib directory.
See Also