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

Name

Description

data

Pointer to the bytes to send.

len

Number of bytes to send.

flags

Flags passed through to send(2).

Created with MrDocs