OpenTTD Source 20260311-master-g511d3794ce
SocketSender Struct Reference

IPv4 addresses should be 4 bytes. More...

#include <os_abstraction.h>

Public Member Functions

ssize_t operator() (std::span< const uint8_t > buffer)
 Write the buffer to the socket.

Data Fields

SOCKET sock
 The socket we're sending data to.

Detailed Description

IPv4 addresses should be 4 bytes.

IPv6 addresses should be 16 bytes. Helper for Packet::TransferOut that writes data to a socket.

Definition at line 141 of file os_abstraction.h.

Member Function Documentation

◆ operator()()

ssize_t SocketSender::operator() ( std::span< const uint8_t > buffer)
inline

Write the buffer to the socket.

Parameters
bufferThe buffer to write.
Returns
The number of elements/bytes that were written, or -1 upon an error.

Definition at line 149 of file os_abstraction.h.

Field Documentation

◆ sock

SOCKET SocketSender::sock

The socket we're sending data to.

Definition at line 142 of file os_abstraction.h.


The documentation for this struct was generated from the following file: