MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxnetwork::MXNetworkInit Struct Reference

RAII helper that initializes and shuts down the platform socket subsystem. More...

#include <MXNetwork/include/mxnetwork/socket.hpp>

Public Member Functions

 MXNetworkInit ()
 Initialize the socket backend for the current process.
 MXNetworkInit (const MXNetworkInit &)=delete
MXNetworkInitoperator= (const MXNetworkInit &)=delete
 ~MXNetworkInit ()
 Shut down the socket backend.

Detailed Description

RAII helper that initializes and shuts down the platform socket subsystem.

Definition at line 21 of file socket.hpp.

Constructor & Destructor Documentation

◆ MXNetworkInit() [1/2]

mxnetwork::MXNetworkInit::MXNetworkInit ( )

Initialize the socket backend for the current process.

Definition at line 14 of file socket.cpp.

14 {
15#ifdef _WIN32
16 WSADATA wsaData;
17 int err = WSAStartup(MAKEWORD(2, 2), &wsaData);
18 if (err != 0) {
19 fprintf(stderr, "WSAStartup failed with error: %d\n", err);
20 exit(1);
21 }
22#endif
23 }

◆ ~MXNetworkInit()

mxnetwork::MXNetworkInit::~MXNetworkInit ( )

Shut down the socket backend.

Definition at line 25 of file socket.cpp.

25 {
26#ifdef _WIN32
27 WSACleanup();
28#endif
29 }

◆ MXNetworkInit() [2/2]

mxnetwork::MXNetworkInit::MXNetworkInit ( const MXNetworkInit & )
delete

Member Function Documentation

◆ operator=()

MXNetworkInit & mxnetwork::MXNetworkInit::operator= ( const MXNetworkInit & )
delete

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