aboutsummaryrefslogtreecommitdiffstats
path: root/src/message.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-13 00:22:34 +0200
committerMattias Andrée <maandree@kth.se>2016-07-13 00:22:34 +0200
commit04498e56aeef5a3e1b89b07745ebc226bd059707 (patch)
treef4b0927cd64dcd6c6f4a64e574d9078bfe3fc6b9 /src/message.h
parentImplement main loop and handling of inbound connections + remove server_message (though like this was an mds server and not a stand-alone server) (diff)
downloadcoopgammad-04498e56aeef5a3e1b89b07745ebc226bd059707.tar.gz
coopgammad-04498e56aeef5a3e1b89b07745ebc226bd059707.tar.bz2
coopgammad-04498e56aeef5a3e1b89b07745ebc226bd059707.tar.xz
Work on handling requests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/message.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/message.h b/src/message.h
index 15ceaf7..d1d6840 100644
--- a/src/message.h
+++ b/src/message.h
@@ -120,13 +120,14 @@ size_t message_unmarshal(struct message* this, const void* buf);
*
* @param this Memory slot in which to store the new message
* @param fd The file descriptor
- * @return Non-zero on error or interruption, `errno` will be
- * set accordingly. Destroy the message on error,
- * be aware that the reading could have been
- * interrupted by a signal rather than canonical error.
- * If -2 is returned `errno` will not have been set,
- * -2 indicates that the message is malformated,
- * which is a state that cannot be recovered from.
+ * @return 0: At least one message is available
+ * -1: Exceptional connection:
+ * EINTR: System call interrupted
+ * EAGAIN: No message is available
+ * EWOULDBLOCK: No message is available
+ * ECONNRESET: Connection closed
+ * Other: Failure
+ * -2: Corrupt message (unrecoverable)
*/
int message_read(struct message* this, int fd);