Sends data to a specific destination address.

Synopsis

Declared in <folly/net/NetOps.h>

ssize_t
sendto(
    NetworkSocket s,
    void const* buf,
    size_t len,
    int flags,
    sockaddr const* to,
    socklen_t tolen);

Return Value

The number of bytes sent, or ‐1 on error.

Parameters

Name

Description

s

The socket to send on.

buf

The data to send.

len

The number of bytes to send.

flags

Send flags.

to

The destination address.

tolen

The length of the destination address.

Created with MrDocs