EHS
Loading...
Searching...
No Matches
ehs::BaseUDP Class Referenceabstract

#include <BaseUDP.h>

Inheritance diagram for ehs::BaseUDP:
ehs::UDP ehs::UDP

Public Member Functions

virtual ~BaseUDP ()=default
 
 BaseUDP ()
 Initializes the socket with the defaults.
 
 BaseUDP (IP version)
 
 BaseUDP (BaseUDP &&udp) noexcept
 
 BaseUDP (const BaseUDP &udp)
 
BaseUDPoperator= (BaseUDP &&udp) noexcept
 
BaseUDPoperator= (const BaseUDP &udp)
 
virtual void Release ()=0
 Explicitly release resources before it falls off the stack.
 
virtual void Bind (const Endpoint &endpoint)=0
 
virtual UInt_64 Send (const Endpoint &endpoint, const Byte *data, UInt_64 size)=0
 
virtual UInt_64 Receive (Endpoint *endpoint, Byte *data, UInt_64 size)=0
 
bool IsBound () const
 
virtual void SetBlocking (bool blocking)=0
 
virtual bool IsBlocking () const =0
 
virtual void SetIPv6Only (bool value)=0
 
virtual bool IsIPv6Only () const =0
 
Endpoint GetLocalEndpoint () const
 
virtual bool IsValid () const =0
 

Protected Attributes

Endpoint localEndpoint
 
bool bound
 

Constructor & Destructor Documentation

◆ ~BaseUDP()

virtual ehs::BaseUDP::~BaseUDP ( )
virtualdefault

◆ BaseUDP() [1/4]

ehs::BaseUDP::BaseUDP ( )

Initializes the socket with the defaults.

◆ BaseUDP() [2/4]

ehs::BaseUDP::BaseUDP ( IP version)

Properly initializes the socket.

Parameters
[in]typeThe ip version to initialize the socket with.

◆ BaseUDP() [3/4]

ehs::BaseUDP::BaseUDP ( BaseUDP && udp)
noexcept

◆ BaseUDP() [4/4]

ehs::BaseUDP::BaseUDP ( const BaseUDP & udp)

Member Function Documentation

◆ Bind()

virtual void ehs::BaseUDP::Bind ( const Endpoint & endpoint)
pure virtual

Binds to socket to a specified address and port.

Parameters
[in]typeThe ip version to use.
[in]addressThe ip address to bind to.
[in]portThe port to bind to.
Note
Used for servers.

Implemented in ehs::UDP, and ehs::UDP.

◆ GetLocalEndpoint()

Endpoint ehs::BaseUDP::GetLocalEndpoint ( ) const

◆ IsBlocking()

virtual bool ehs::BaseUDP::IsBlocking ( ) const
pure virtual

Retrieves whether or not when receiving data blocks the thread.

Returns
The result.

Implemented in ehs::UDP, and ehs::UDP.

◆ IsBound()

bool ehs::BaseUDP::IsBound ( ) const

Retrieves whether or not this socket is bound to an ip address and port.

Returns
The result.

◆ IsIPv6Only()

virtual bool ehs::BaseUDP::IsIPv6Only ( ) const
pure virtual

Implemented in ehs::UDP, and ehs::UDP.

◆ IsValid()

virtual bool ehs::BaseUDP::IsValid ( ) const
pure virtual

Retrieves whether or not this socket was initialized.

Returns
The result.

Implemented in ehs::UDP, and ehs::UDP.

◆ operator=() [1/2]

BaseUDP & ehs::BaseUDP::operator= ( BaseUDP && udp)
noexcept

◆ operator=() [2/2]

BaseUDP & ehs::BaseUDP::operator= ( const BaseUDP & udp)

◆ Receive()

virtual UInt_64 ehs::BaseUDP::Receive ( Endpoint * endpoint,
Byte * data,
UInt_64 size )
pure virtual

Receives data from the endpoint.

Parameters
[out]typeThe ip version of the endpoint.
[out]addressThe ip address of the endpoint.
[out]portThe port of the endpoint.
[out]dataThe incoming data from the endpoint.
[in]sizeThe max size of the buffer in bytes to store the data.
Returns
The size of the incoming data in bytes.

Implemented in ehs::UDP, and ehs::UDP.

◆ Release()

virtual void ehs::BaseUDP::Release ( )
pure virtual

Explicitly release resources before it falls off the stack.

Implemented in ehs::UDP, and ehs::UDP.

◆ Send()

virtual UInt_64 ehs::BaseUDP::Send ( const Endpoint & endpoint,
const Byte * data,
UInt_64 size )
pure virtual

Sends data to the endpoint.

Parameters
[in]typeThe ip version of the endpoint.
[in]addressThe ip address of the endpoint.
[in]portThe port of the endpoint is bound to.

Implemented in ehs::UDP, and ehs::UDP.

◆ SetBlocking()

virtual void ehs::BaseUDP::SetBlocking ( bool blocking)
pure virtual

Sets whether or not the socket blocks the thread when receiving data.

Parameters
[in]blockingWhether or not to block.

Implemented in ehs::UDP, and ehs::UDP.

◆ SetIPv6Only()

virtual void ehs::BaseUDP::SetIPv6Only ( bool value)
pure virtual

Implemented in ehs::UDP, and ehs::UDP.

Member Data Documentation

◆ bound

bool ehs::BaseUDP::bound
protected

◆ localEndpoint

Endpoint ehs::BaseUDP::localEndpoint
protected

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