I have been trying to answer my own question with some experiments:
from until not client_socket.is_readable loop
client
_socket.read_line
..
end
However this did not work at all in the example I tried. But on examining the source for routine {SOCKET}.read_line, it does seem that calling `was_error' is the only way to detect the end of the transmission.
read_line, readline
-- Read a line of characters (ended by a new_line).
local
l_last_string: like last_string
do
create l_last_string.make (512)
read_character
from
until
last_character = '%N' or else was_error
loop
l_last_string.extend (last_character)
read_character
end
last_string := l_last_string
end
Nothing wrong with this I guess, although it does seem a bit odd that doing something this natural is treated as an error condition.