LargeSocketWrite
(System Library)
Description: | Paces the write speed to prevent exceeding the socket output buffer limit. |
Returns: | None. |
Usage: | Script Only. |
Function Groups: | Stream and Socket |
Related to: | | SocketAttribs |ClientSocket |
Format: | System.LargeSocketWrite(Stream, Source) |
Parameters: |
Stream |
The socket stream to which data will be written. |
Source |
A stream or text value containing the data to write. |
Comments: |
LargeSocketWrite writes as many bytes as there is space in the socket output buffer and then waits for there to be space for some more before writing more bytes until all content in Source has been drained. It is a launched module and so you should launch it and wait for completion (the object value returned from the launch statement goes Invalid). Failure to do so may result in not all data being written. LargeSocketWrite is more efficient if a stream is passed in the Source parameter - a text value is first converted to a BuffStream before writing and the BuffStream discarded after the write completes. If the Source Parameter is a stream, writing to the socket starts from the current position in the stream. The Source stream is not repositioned at the end of the write. Passing in a Stream parameter that is not a ClientSocket or ServerSocket stream does nothing and LargeSocketWrite will terminate quickly.
|