int InetTelnetReadUntil (int telnetHandle, char readBuffer[], const char *stringToMatch, int timeout);
Reads from the Telnet connection until stringToMatch is found or timeout ms have elapsed or readBufferLength - 1 bytes have been read. The data is copied into the readBuffer.
Returns 0 if successful or a negative error code otherwise.
![]() |
Note This function returns timeout as an error. |
Input | ||||
Name | Type | Description | ||
telnetHandle | integer | An integer handle identifying the Telnet connection. You can call InetTelnetOpen to obtain this handle. | ||
readBufferLength | const char * | Length of the array passed to the Read Buffer parameter in bytes. |
||
stringToMatch | const char * | When this string is read from the Telnet connection, the function returns. stringToMatch must be a NUL–terminated string. |
||
timeout | integer | Timeout in milliseconds. After timeout ms elapse, the function returns with an error. Passing –1 for timeout causes InetTelnetReadUntil to read indefinitely for stringToMatch. |
||
Output | ||||
Name | Type | Description | ||
readBuffer | char [] | The data read from the Telnet connection with the Telnet control characters filtered out. readBuffer must be able to hold all the bytes read through the last byte in the stringToMatch plus one extra byte for the NUL character. Passing NULL for readBuffer causes the function to read for the stringToMatch while discarding the data read.
|
Name | Type | Description |
result | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred. |