read(2)/write(2) wrappers for reliable delivery
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1850 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
/**
|
||||
* \brief Socket based communictaion wrapper functions.
|
||||
* \brief Socket based communication wrapper functions.
|
||||
*/
|
||||
|
||||
#ifndef __SOCKET_COMM_HPP__
|
||||
#define __SOCKET_COMM_HPP__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
@ -34,6 +35,10 @@ public:
|
||||
* \return false if message reception failed
|
||||
*/
|
||||
static bool rcvMsg(int sockfd, google::protobuf::Message& msg);
|
||||
|
||||
private:
|
||||
static ssize_t safe_write(int fd, const void *buf, size_t count);
|
||||
static ssize_t safe_read(int fd, void *buf, size_t count);
|
||||
};
|
||||
|
||||
} // end-of-namespace: fail
|
||||
|
||||
Reference in New Issue
Block a user