Sock::Send

send(2) wrapper. Equivalent to send(m_socket, data, len, flags);. Code that uses this wrapper can be unit tested if this method is overridden by a mock Sock implementation.

Synopsis

Declared in <util/sock.h>

[[nodiscard]]
virtual
ssize_t
Send(
    void const* data,
    size_t len,
    int flags) const;

Return Value

Number of bytes sent, or -1 on error (with errno set).

NOTE

The return value should not be discarded.

Parameters

NameDescription
dataPointer to the bytes to send.
lenNumber of bytes to send.
flagsFlags passed through to send(2).