:Read()
Class
Syntax
:Read( [hSession], [nRetType], [lShowProgress], [nBufferLength], [bCallback], [nTotalBytes] ) --> acMessage
Parameters
|
|
hSession |
Optional. Session (Socket) handle. If hSession is not passed, the value in :Session will be used. |
|
|
nRetType |
Optional. Return type constant. See table below. |
|
|
lShowProgress |
Optional. Logical. Whether or not to show an updated User status. |
|
|
nBufferLength |
Optional. Number of Bytes to read for each read cycle. Adjust for granularity of status. The lower the number of Bytes, the more frequently the status is updated. Defaults to 1024 Bytes |
|
|
bCallback |
Optional. Codeblock to update status for User. |
|
|
nTotalBytes |
Optional. Total number of Bytes expected. Used to calculate percentage completed. |
Return
The return type depends on the value of nRetType.
|
RETURN_DEFAULT |
Returns the data as a string. |
|
RETURN_ARRAY |
Returns the data as an array. |
acMessage contains the text response from the last call to the remote server.
Description
When a request is made to the remote server, :Read() will capture the text stream of the Server's response.
If lShowProgress is set to True (.T.) and bCallback is not provided, aSocks will use aprMsg() to update the status of the operation. If bCallback is provided, it will receive the updates.
The status is updated after every nBufferLength Bytes are read.
The Callback is sent the following parameters:
|
|
nReadCount |
Number of Read operations completed |
|
|
nBytesReceived |
Number of Bytes received |
|
|
nTotalBytes |
Total number of Bytes expected (provided by the calling application). If not provided in the original call to :Read(), it is the same a nBytesReceived. |
|
|
lComplete |
Logical indicating if the :Read() method is done. |
See Also