EHS
|
A wrapper class for the user datagram protocol socket. More...
#include <UDP_BSD.h>
Public Member Functions | |
~UDP () override | |
Frees any native handles. More... | |
UDP () | |
UDP (IP version) | |
Default members initialization. More... | |
UDP (UDP &&udp) noexcept | |
UDP (const UDP &udp) | |
UDP & | operator= (UDP &&udp) noexcept |
UDP & | operator= (const UDP &udp) |
void | Release () override |
Frees native handles and uninitializes them. More... | |
void | Bind (const Endpoint &endpoint) override |
UInt_64 | Send (const Endpoint &endpoint, const Byte *data, UInt_64 size) override |
UInt_64 | Receive (Endpoint *endpoint, Byte *data, UInt_64 size) override |
void | SetBlocking (bool blocking) override |
bool | IsBlocking () const override |
void | SetIPv6Only (bool value) override |
bool | IsIPv6Only () const override |
bool | IsValid () const override |
~UDP () override | |
Frees any native handles. More... | |
UDP () | |
UDP (const IP IP) | |
Default members initialization. More... | |
UDP (UDP &&udp) noexcept | |
UDP (const UDP &udp) | |
UDP & | operator= (UDP &&udp) noexcept |
UDP & | operator= (const UDP &udp) |
void | Release () override |
Frees native handles and uninitializes them. More... | |
void | Bind (const Endpoint &endpoint) override |
UInt_64 | Send (const Endpoint &endpoint, const Byte *data, UInt_64 size) override |
UInt_64 | Receive (Endpoint *endpoint, Byte *data, UInt_64 size) override |
void | SetBlocking (bool blocking) override |
bool | IsBlocking () const override |
void | SetIPv6Only (bool value) override |
bool | IsIPv6Only () const override |
bool | IsValid () const override |
![]() | |
virtual | ~BaseUDP ()=default |
BaseUDP () | |
Initializes the socket with the defaults. More... | |
BaseUDP (IP version) | |
BaseUDP (BaseUDP &&udp) noexcept | |
BaseUDP (const BaseUDP &udp) | |
BaseUDP & | operator= (BaseUDP &&udp) noexcept |
BaseUDP & | operator= (const BaseUDP &udp) |
virtual void | Release ()=0 |
Explicitly release resources before it falls off the stack. More... | |
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 |
Additional Inherited Members | |
![]() | |
Endpoint | localEndpoint |
bool | bound |
A wrapper class for the user datagram protocol socket.
|
override |
Frees any native handles.
ehs::UDP::UDP | ( | ) |
ehs::UDP::UDP | ( | IP | version | ) |
Default members initialization.
|
noexcept |
ehs::UDP::UDP | ( | const UDP & | udp | ) |
|
override |
Frees any native handles.
ehs::UDP::UDP | ( | ) |
ehs::UDP::UDP | ( | const IP | IP | ) |
Default members initialization.
|
noexcept |
ehs::UDP::UDP | ( | const UDP & | udp | ) |
|
overridevirtual |
Binds the UDP socket to a local address and port.
[in] | address | The local IPv4 or IPv6 address to bind to. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device. |
[in] | port | The port to bind to. |
Implements ehs::BaseUDP.
|
overridevirtual |
Binds the UDP socket to a local address and port.
[in] | address | The local IPv4 or IPv6 address to bind to. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device. |
[in] | port | The port to bind to. |
Implements ehs::BaseUDP.
|
overridevirtual |
Retrieves whether or not this socket will block when receiving data.
Implements ehs::BaseUDP.
|
overridevirtual |
Retrieves whether or not this socket will block when receiving data.
Implements ehs::BaseUDP.
|
overridevirtual |
Implements ehs::BaseUDP.
|
overridevirtual |
Implements ehs::BaseUDP.
|
overridevirtual |
|
overridevirtual |
Receives data using the packet helper class.
[out] | addr | The Ipv4 or Ipv6 address of the sender. |
[out] | port | The port of the sender. |
[out] | data | The C-style byte array received. |
[in] | size | The size of the pre-allocated C-style byte array. |
Implements ehs::BaseUDP.
Receives data using the packet helper class.
[out] | addr | The Ipv4 or Ipv6 address of the sender. |
[out] | port | The port of the sender. |
[out] | data | The C-style byte array received. |
[in] | size | The size of the pre-allocated C-style byte array. |
Implements ehs::BaseUDP.
|
overridevirtual |
Frees native handles and uninitializes them.
Implements ehs::BaseUDP.
|
overridevirtual |
Frees native handles and uninitializes them.
Implements ehs::BaseUDP.
|
overridevirtual |
Sends data using a C-style byte array.
[in] | addr | The remote Ipv4 or Ipv6 address to send to. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device. |
[in] | port | The remote port to send to. |
[in] | data | The C-style byte array to send. |
[in] | size | The size of the C-style byte array. |
Implements ehs::BaseUDP.
|
overridevirtual |
Sends data using a C-style byte array.
[in] | addr | The remote Ipv4 or Ipv6 address to send to. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device. |
[in] | port | The remote port to send to. |
[in] | data | The C-style byte array to send. |
[in] | size | The size of the C-style byte array. |
Implements ehs::BaseUDP.
|
overridevirtual |
Sets whether or not receiving data blocks the next task.
[in] | blocking | Whether or not to block. |
Implements ehs::BaseUDP.
|
overridevirtual |
Sets whether or not receiving data blocks the next task.
[in] | blocking | Whether or not to block. |
Implements ehs::BaseUDP.
|
overridevirtual |
Implements ehs::BaseUDP.
|
overridevirtual |
Implements ehs::BaseUDP.