diff --git a/slsSupportLib/include/sls/DataSocket.h b/slsSupportLib/include/sls/DataSocket.h index 5d591d204..c8c7fc75e 100644 --- a/slsSupportLib/include/sls/DataSocket.h +++ b/slsSupportLib/include/sls/DataSocket.h @@ -77,8 +77,6 @@ class DataSocket { std::string Receive(size_t length); - int read(void *buffer, size_t size); - int write(void *buffer, size_t size); int setTimeOut(int t_seconds); int setReceiveTimeout(int us); void close(); diff --git a/slsSupportLib/src/DataSocket.cpp b/slsSupportLib/src/DataSocket.cpp index 5ed6ee5b5..a8b4d2bfd 100644 --- a/slsSupportLib/src/DataSocket.cpp +++ b/slsSupportLib/src/DataSocket.cpp @@ -141,21 +141,6 @@ int DataSocket::Send(const void *buffer, size_t size) { int DataSocket::Send(const std::string &s) { return Send(&s[0], s.size()); } -int DataSocket::write(void *buffer, size_t size) { - // Use send() with MSG_NOSIGNAL (Linux) to avoid SIGPIPE on a broken - // connection; macOS/BSD rely on SO_NOSIGPIPE set in the constructor. -#ifdef MSG_NOSIGNAL - const int send_flags = MSG_NOSIGNAL; -#else - const int send_flags = 0; -#endif - return ::send(getSocketId(), buffer, size, send_flags); -} - -int DataSocket::read(void *buffer, size_t size) { - return ::read(getSocketId(), buffer, size); -} - int DataSocket::setReceiveTimeout(int us) { timeval t{}; t.tv_sec = us / 1000000; diff --git a/slsSupportLib/src/ServerInterface.cpp b/slsSupportLib/src/ServerInterface.cpp index 92e3d7a67..8e2d4a503 100644 --- a/slsSupportLib/src/ServerInterface.cpp +++ b/slsSupportLib/src/ServerInterface.cpp @@ -10,16 +10,16 @@ namespace sls { int ServerInterface::sendResult(int ret, void *retval, int retvalSize, char *mess) { - write(&ret, sizeof(ret)); + Send(&ret, sizeof(ret)); if (ret == defs::FAIL) { if (mess != nullptr) { - write(mess, MAX_STR_LENGTH); + Send(mess, MAX_STR_LENGTH); } else { LOG(logERROR) << "No error message provided for this " "failure. Will mess up TCP\n"; } } else { - write(retval, retvalSize); + Send(retval, retvalSize); } return ret; }