Receive

The Receive function receives the data from Internet host.

Receive data

Parameters

data
The variable that will accept the received data

Return value

The function returns the number of received bytes. If function returns zero, then either all data are read or an error occured. To know the reason, use the LastError property.
It is recommended to check the return value in the scripts to determine the end of being received data.

Notes

The TCP/IP connection should previously be opened by calling the Open function.
The accepted data are placed into the first parameter variable.
If the BinaryMode property set the binary mode, the result is a safearray of bytes. The maximal size of array is defined by BufferSize property. Later you can write array to file, or convert it to string using the WriteFile function. The next calling this function returns the next portion of data etc. until all data will be received.
If the BinaryMode property set the text mode, the subsequent callings of this function will place the strings into the data variable, one string per calling, string by string. The received strings are cleared from the finishing CR/LF symbols.

Example
Every example from ASP examples contains this function callings.