Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.59 KB

SocketSystem_CreateSocketSystem.md

File metadata and controls

46 lines (32 loc) · 1.59 KB

SocketSystem::CreateSocketSystem

API version: v0

What is it?

Before a developer can use maxSocket they must create a SocketSystem by calling SocketSystem::CreateSocketSystem.

Signature

static CreateSocketSystemResults::Enum SocketSystem::CreateSocketSystem(

    std::unique_ptr< SocketSystem > & CreatedSocketSystem

) MAX_DOES_NOT_THROW;

Parameters

  • CreatedSocketSystem
    • On success, this parameter will be populated with the created SocketSystem.
    • If this parameter previously referenced a SocketSystem, that SocketSystem will be destroyed.

Returns

  • On success, returns CreateSocketSystemResults::Success
  • On error, returns:
Value Description
CreateSocketSystemResults::SystemIsNotReady when the underlying network system is not ready. A developer can try again later.
CreateSocketSystemResults::NoSystemSupport when the OS does not meet the minimum requirements for maxSocket.
CreateSocketSystemResults::LibraryError when there is an error in maxSocket's logic. Please notify us if you ever see a LibraryError.
CreateSocketSystemResults::UnknownError when there is an error maxSocket is not aware of. Please notify us if you ever see an UnknownError.

Example

auto SocketSystem = std::unique_ptr< maxSocket::SocketSystem >{};
auto CreateSocketSystemResult = maxSocket::SocketSystem::CreateSocketSystem( SocketSystem );
if( CreateSocketSystemResult != maxSocket::CreateSocketSystemResults::Success )
{
    // error
}