// Copyright (C) 2020 Jérôme Leclercq // This file is part of the "Nazara Engine - Network module" // For conditions of distribution and use, see copyright notice in Config.hpp #include #include #include #include #include #include #include #include #if defined(NAZARA_PLATFORM_WINDOWS) #include #elif defined(NAZARA_PLATFORM_POSIX) #include #else #error Missing implementation: Network #endif #include #include namespace Nz { /*! * \ingroup network * \class Nz::Network * \brief Network class that represents the module initializer of Network */ Network::Network() : Module("Network", this) { // Initialize module here if (!SocketImpl::Initialize()) throw std::runtime_error("failed to initialize socket implementation"); if (!NetPacket::Initialize()) throw std::runtime_error("failed to initialize packets"); if (!RUdpConnection::Initialize()) throw std::runtime_error("failed to initialize RUDP protocol"); } Network::~Network() { // Uninitialize module here RUdpConnection::Uninitialize(); NetPacket::Uninitialize(); SocketImpl::Uninitialize(); } Network* Network::s_instance = nullptr; }