From ce5160a39d26a8e7cf0633d0d144436a5156837a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 19 Aug 2015 13:37:19 +0200 Subject: put full_send in libmdsserver, clients that only has one socket uses a macro to remove the socket parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsserver/util.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/libmdsserver/util.h') diff --git a/src/libmdsserver/util.h b/src/libmdsserver/util.h index 685f971..accf038 100644 --- a/src/libmdsserver/util.h +++ b/src/libmdsserver/util.h @@ -128,6 +128,18 @@ int full_write(int fd, const char* buffer, size_t length); */ char* full_read(int fd, size_t* length); + +/** + * Send a full message even if interrupted + * + * @param socket The file descriptor for the socket to use + * @param message The message to send + * @param length The length of the message + * @return Zero on success, -1 on error + */ +int full_send(int socket, const char* message, size_t length); + + /** * Check whether a string begins with a specific string, * where neither of the strings are necessarily NUL-terminated -- cgit v1.2.3-70-g09d2