OpenTTD Source 20260421-master-gc2fbc6fdeb
UDPSocket Struct Reference

Some information about a socket, which exists before the actual socket has been created to provide locking and the likes. More...

Public Member Functions

 UDPSocket (const std::string &name)
 Create this socket.
void CloseSocket ()
 Close the actual UDP socket.
void ReceivePackets ()
 Receive a packet at UDP level.

Data Fields

const std::string name
 The name of the socket.
std::unique_ptr< NetworkUDPSocketHandlersocket = nullptr
 The actual socket, which may be nullptr when not initialized yet.

Detailed Description

Some information about a socket, which exists before the actual socket has been created to provide locking and the likes.

Definition at line 29 of file network_udp.cpp.

Constructor & Destructor Documentation

◆ UDPSocket()

UDPSocket::UDPSocket ( const std::string & name)
inline

Create this socket.

Parameters
nameThe name of the socket for logging purposes.

Definition at line 37 of file network_udp.cpp.

References name.

Member Function Documentation

◆ CloseSocket()

void UDPSocket::CloseSocket ( )
inline

Close the actual UDP socket.

Definition at line 40 of file network_udp.cpp.

◆ ReceivePackets()

void UDPSocket::ReceivePackets ( )
inline

Receive a packet at UDP level.

Definition at line 47 of file network_udp.cpp.

Field Documentation

◆ name

const std::string UDPSocket::name

The name of the socket.

Definition at line 30 of file network_udp.cpp.

Referenced by UDPSocket().

◆ socket

std::unique_ptr<NetworkUDPSocketHandler> UDPSocket::socket = nullptr

The actual socket, which may be nullptr when not initialized yet.

Definition at line 31 of file network_udp.cpp.


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