Civetweb API Reference
mg_read( conn, buf, len );
struct mg_connection *
|A pointer referencing the connection|
|A pointer to the location where the received data can be stored|
|The maximum number of bytes to be stored in the buffer|
|The number of read bytes, or a status indication|
mg_read() receives data over an existing connection. The data is handled as binary and is stored in a buffer whose address has been provided as a parameter. The function returns the number of read bytes when successful, the value 0 when the connection has been closed by peer and a negative value when no more data could be read from the connection.