- 
                Notifications
    You must be signed in to change notification settings 
- Fork 189
Closed
Description
size_t SocketOutput::DoWrite(const void* data, size_t len) {
#if defined (_linux_)
    static const int flags = MSG_NOSIGNAL;
#else
    static const int flags = 0;
#endif
    if (::send(s_, (const char*)data, (int)len, flags) != (int)len) {
        throw std::system_error(getSocketErrorCode(), getErrorCategory(), "fail to send " + std::to_string(len) + " bytes of data");
    }
    return len;
}Hello.
Checking the inequality of the size of the sent data and the size of the input data will not always correctly indicate problems. Sometimes, even for a blocking socket, the send function can return a size smaller than the one passed to the function. And only if the function returned the value -1, this will indicate errors.
Created PR #404 with implementation of change to function return result check. @Enmk Please check.
Metadata
Metadata
Assignees
Labels
No labels