SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL::DatagramSocketBase Struct Reference

Base class to DatagramSocket. More...

Inheritance diagram for SDL::DatagramSocketBase:
[legend]

Public Member Functions

void Destroy ()
 Dispose of a previously-created datagram socket.
bool SendDatagram (AddressRef address, Uint16 port, const void *buf, int buflen)
 Send a new packet over a datagram socket to a remote system.
bool ReceiveDatagram (Datagram &dgram)
 Receive a new packet that a remote system sent to a datagram socket.
Datagram ReceiveDatagram ()
 Receive a new packet that a remote system sent to a datagram socket.
void SimulateDatagramPacketLoss (int percent_loss)
 Enable simulated datagram socket failures.
constexpr ResourceBaseT ()=default
 Default constructor, creates null/invalid resource.
constexpr ResourceBaseT (RawPointer resource)
 Constructs from resource pointer.
constexpr ResourceBaseT (std::nullptr_t)
 Constructs null/invalid.
constexpr ResourceBaseT (const ResourceBaseT &)=default
 Copy constructor.
constexpr ResourceBaseT (ResourceBaseT &&) noexcept=default
 Move constructor.
Public Member Functions inherited from SDL::ResourceBaseT< DatagramSocketRaw >
constexpr ResourceBaseT ()=default
 Default constructor, creates null/invalid resource.
constexpr operator bool () const
 Converts to bool.
constexpr auto operator<=> (const ResourceBaseT &other) const=default
 Comparison.
constexpr RawConstPointer operator-> () const noexcept
 member access to underlying resource pointer.
constexpr RawPointer get () const noexcept
 Retrieves underlying resource pointer.
constexpr RawPointer release () noexcept
 Retrieves underlying resource pointer and clear this.

Additional Inherited Members

Public Types inherited from SDL::ResourceBaseT< DatagramSocketRaw >
using RawPointer
 The underlying raw pointer type.
using RawConstPointer
 The underlying const raw pointer type.
Protected Member Functions inherited from SDL::ResourceBaseT< DatagramSocketRaw >
constexpr ~ResourceBaseT ()=default
 Destructor.
constexpr ResourceBaseToperator= (const ResourceBaseT &)=default
 Assignment operator.

Detailed Description

Base class to DatagramSocket.

See also
DatagramSocket

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