diff options
author | Mattias Andrée <maandree@kth.se> | 2016-07-13 00:22:34 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-07-13 00:22:34 +0200 |
commit | 04498e56aeef5a3e1b89b07745ebc226bd059707 (patch) | |
tree | f4b0927cd64dcd6c6f4a64e574d9078bfe3fc6b9 /src/message.c | |
parent | Implement main loop and handling of inbound connections + remove server_message (though like this was an mds server and not a stand-alone server) (diff) | |
download | coopgammad-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.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/message.c b/src/message.c index 343a26b..fd7d030 100644 --- a/src/message.c +++ b/src/message.c @@ -458,13 +458,14 @@ static int continue_read(struct message* this, int fd) * * @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) { |