skip to main content

Library Routines : C$SOCKET : CSOCKET-READ

CSOCKET-READ
This operation reads data from a socket. It blocks other calls until all the data requested is actually read, an error occurs or the read timeout expires.
If the socket is closed by the other peer before the entire buffer is filled, C$SOCKET will return the number of bytes read to that point, which will be less than the amount requested. The next time AGS-READ is called, -1 will be returned.
Syntax:
 CALL "C$SOCKET" USING CSOCKET-READ
Parameters:
Optional parameter. It specifies the amount of milliseconds that C$SOCKET has to wait before returning if less data than the amount specified by length is available on the socket. When the timeout expires, buffer is set to the available data. If the parameter is omitted, then C$SOCKET waits until the number of bytes specified by length has been read.
Return code:
returnCode can be any signed numeric data item and provides additional information:

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left