int valvula_readline ( ValvulaConnection connection,
char *  buffer,
int  maxlen 

Read the next line, byte by byte until it gets a
or maxlen is reached.

Some code errors are used to manage exceptions (see return values)

connectionThe connection where the read operation will be done.
bufferA buffer to store content read from the network.
maxlenmax content to read from the network.
values returned by this function follows: 0 - remote peer have closed the connection -1 - an error have happened while reading -2 - could read because this connection is on non-blocking mode and there is no data. n - some data was read.

References valvula_connection_close(), valvula_connection_get_ctx(), valvula_connection_get_socket(), and valvula_connection_is_ok().