SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches

The receiving end of a stream connection. More...

Inheritance diagram for SDL::Server:
[legend]

Public Member Functions

constexpr Server (ServerRaw resource) noexcept
 Constructs from raw Server.
constexpr Server (Server &&other) noexcept
 Move constructor.
 Server (AddressRef addr, Uint16 port, PropertiesRef props)
 Create a server, which listens for connections to accept.
 ~Server ()
 Destructor.
constexpr Serveroperator= (Server &&other) noexcept
 Assignment operator.
Public Member Functions inherited from SDL::ServerBase
void Destroy ()
 Dispose of a previously-created server.
void AcceptClient (NET_StreamSocket **client_stream)
 Create a stream socket for the next pending client connection.
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< ServerRaw >
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< ServerRaw >
using RawPointer
 The underlying raw pointer type.
using RawConstPointer
 The underlying const raw pointer type.
Protected Member Functions inherited from SDL::ResourceBaseT< ServerRaw >
constexpr ~ResourceBaseT ()=default
 Destructor.
constexpr ResourceBaseToperator= (const ResourceBaseT &)=default
 Assignment operator.

Detailed Description

The receiving end of a stream connection.

This is an opaque datatype, to be treated by the app as a handle.

Internally, this is what BSD sockets refers to as a "listen socket". Clients attempt to connect to a server, and if the server accepts the connection, will provide the app with a stream socket to send and receive data over that connection.

Since
This datatype is available since SDL_net 3.0.0.
See also
CreateServer
Category:
Resource

Constructor & Destructor Documentation

◆ Server()

SDL::Server::Server ( ServerRaw resource)
inlineexplicitconstexprnoexcept

Constructs from raw Server.

Parameters
resourcea ServerRaw to be wrapped.

This assumes the ownership, call release() if you need to take back.


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