OpenTTD Source 20260311-master-g511d3794ce
SocketReceiver Struct Reference

Helper for Packet::TransferIn that reads data from a socket. More...

#include <os_abstraction.h>

Public Member Functions

ssize_t operator() (std::span< uint8_t > buffer)
 Read data from the socket into the buffer.

Data Fields

SOCKET sock
 The socket we're receiving data from.

Detailed Description

Helper for Packet::TransferIn that reads data from a socket.

Definition at line 156 of file os_abstraction.h.

Member Function Documentation

◆ operator()()

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

Read data from the socket into the buffer.

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

Definition at line 164 of file os_abstraction.h.

Field Documentation

◆ sock

SOCKET SocketReceiver::sock

The socket we're receiving data from.

Definition at line 157 of file os_abstraction.h.


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