socket_read_line(socket_name=’socket_0’, timeout=2)
Deprecated: Reads the socket buffer until the first "\r\n" (carriage return and newline) characters or just the "\n" (newline) character, and returns the data as a string. The returned string will not contain the "\n" nor the "\r\n" characters.
Returns (for example) "reply from the server:", if there is a timeout or the reply is invalid, an empty line is returned (""). You can test if the line is empty with an if-statement.
>>> if(line_from_server) :
>>> popup("the line is not empty")
>>> end
Parameters
socket_name: Name of socket (string)
timeout: The number of seconds until the read action times out (float). A timeout of 0 or negative number indicates that the function should not return until a read is completed.
Return Value
One line string
Deprecated: The socket_read_string replaces this function. Set flag "interpret_escape" to "True" to enable the use of escape sequences "\n" "\r" and "\t" as a prefix or suffix.
Example command: line_from_server = socket_read_line("socket_10")
- Example Parameters:
- socket_name = socket_10