diff options
-rw-r--r-- | IPCConnection.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/IPCConnection.cpp b/IPCConnection.cpp index 3da91c4..fd50dd1 100644 --- a/IPCConnection.cpp +++ b/IPCConnection.cpp @@ -91,15 +91,17 @@ void IPCConnection::workerLoop() { bool canWrite = (pollFd.revents & POLLOUT) > 0; if (canWrite && !_writeTasks.empty()) { - auto writeTask = std::move(_writeTasks.front()); + auto &writeTask = _writeTasks.front(); + if (_socket.write(writeTask.second.get(), writeTask.first) < 0) { if (errno == EAGAIN) { continue; } - - throw SystemCallException(errno, "write"); + + LOG(LOG_LEVEL_ERROR, "write() failed (errno=%d)", errno); + continue; } - + { std::scoped_lock<std::mutex> scopedWriteTasksLock(_writeTasksLock); _writeTasks.pop(); |