EasySockets v2.0.0
A simple, cross platform socket library for C++.
Loading...
Searching...
No Matches

An object which is required to exist for es::Sockets to be used. More...

#include <WinsockContext.hpp>

Public Member Functions

 WinsockContext ()
 WinsockContext (const WinsockContext &)=delete
WinsockContextoperator= (const WinsockContext &)=delete
 WinsockContext (WinsockContext &&other) noexcept
WinsockContextoperator= (WinsockContext &&other) noexcept
 ~WinsockContext ()
void shutdown ()
 Terminates the context.

Detailed Description

An object which is required to exist for es::Sockets to be used.

This ensures that any underlying setup and cleanup code is called.
For example: es::Context context{}; // must be created before any sockets are created es::Socket socket{es::IpVersion::ipv4, es::Protocol::tcp}; socket.bind({"0.0.0.0", 8080});
Can be moved from but not copied. Members are the same across all implementations.

Constructor & Destructor Documentation

◆ WinsockContext() [1/3]

es::WinsockContext::WinsockContext ( )

◆ WinsockContext() [2/3]

es::WinsockContext::WinsockContext ( const WinsockContext & )
delete

◆ WinsockContext() [3/3]

es::WinsockContext::WinsockContext ( WinsockContext && other)
noexcept

◆ ~WinsockContext()

es::WinsockContext::~WinsockContext ( )

Member Function Documentation

◆ operator=() [1/2]

WinsockContext & es::WinsockContext::operator= ( const WinsockContext & )
delete

◆ operator=() [2/2]

WinsockContext & es::WinsockContext::operator= ( WinsockContext && other)
noexcept

◆ shutdown()

void es::WinsockContext::shutdown ( )

Terminates the context.

Will be called when destructor is called.