Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
socket.write(msg.to_s)
end
+ redef fun write_byte(value)
+ do
+ if closed then return
+ socket.write_byte value
+ end
+
fun write_ln(msg: Text)
do
if end_reached then return
return write(*recv, (char*)String_to_cstring(buffer), String_length(buffer));
`}
+ # Write `value` as a single byte
+ fun write_byte(value: Int): Int `{
+ return write(*recv, &value, 1);
+ `}
+
fun read: String import NativeString.to_s_with_length `{
static char c[1024];
int n = read(*recv, c, 1024);