Reading from a connection¶
read_until accepts a connection and a function of one argument, a byte, that returns a boolean representing whether to read more data from the socket or return whatever has been read so far.
socket\tcp\Connection::read_until connection (\b -> b != 10b)
Reading a line from a connection¶
read_line accepts a connection and returns a line of input delimited by a LF (ASCII 10) character.
Writing to a connection¶
write accepts a connection and a sequence of data (string - sequence of characters, or a sequence of bytes) to be sent to the other side on this connection.
socket\tcp\Connection::write connection "hello"