Class ClientSocket

Inheritance Relationships

Base Type

Class Documentation

class ClientSocket : public combigrid::Socket

Public Functions

ClientSocket(const std::string &host, const int port)
virtual ~ClientSocket()
virtual bool init()
bool sendall(const std::string &mesg) const
bool sendall(const char *buff, size_t len) const
bool sendallPrefixed(const std::string &mesg) const
bool sendallPrefixed(const char *buff, size_t len) const
template<typename FG_ELEMENT>
bool sendallBinary(const FG_ELEMENT *buff, size_t buffSize, int flags = 0) const

Sends the given buffer in binary form. The first byte sent specifies the endianess of the system and is followed by the raw binary data.

bool recvall(std::string &buff, size_t len, int flags = 0) const
bool recvall(char *buff, size_t len, int flags = 0) const
bool recvLength(size_t &length, int flags = 0) const
bool recvallPrefixed(std::string &buff, int flags = 0) const
bool recvallPrefixed(std::unique_ptr<char[]> &buff, size_t &len, int flags = 0) const
template<typename FG_ELEMENT>
bool recvallBinaryAndReduceInPlace(FG_ELEMENT *buff, size_t buffSize, ReduceFcn<FG_ELEMENT> reduceOp, size_t chunksize = 131072, int flags = 0) const
template<typename FG_ELEMENT>
bool recvallBinaryAndCorrectInPlace(FG_ELEMENT *buff, size_t buffSize, size_t chunksize = 131072, int flags = 0) const
bool recvallBinaryToFile(const std::string &filename, size_t len, size_t chunksize = 131072, int flags = 0) const
std::string getRemoteHost() const
int getRemotePort() const
sockaddr_in getSockaddrIn() const
bool isReadable(int timeoutSec = -1) const
bool isWriteable(int timeoutSec = -1) const
template<typename FG_ELEMENT>
bool recvallBinaryAndReduceInPlace(FG_ELEMENT *buff, size_t buffSize, FG_ELEMENT (*reduceOp)(const FG_ELEMENT&, const FG_ELEMENT&), size_t chunksize, int flags) const