#include <udpserver.h>
Public Member Functions | |
UDPServer () | |
virtual | ~UDPServer () |
void | registerListenerSlot (Slot< const UDPPacket & > &slot) |
void | removeListenerSlot (Slot< const UDPPacket & > &slot) |
![]() | |
UDPAdapter () | |
virtual | ~UDPAdapter () |
virtual bool | init (utility::ErrorState &errorState) override final |
virtual void | onDestroy () override final |
virtual bool | start (utility::ErrorState &errorState) override final |
virtual void | stop () override final |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
int | mPort = 13251 |
Property: 'Port' the port the server socket binds to. More... | |
std::string | mIPAddress = "" |
Property: 'IP Address' local ip address to bind to, if left empty will bind to any local address. More... | |
std::vector< std::string > | mMulticastGroups |
Property: 'Multicast Groups' multicast groups to join. More... | |
![]() | |
ResourcePtr< UDPThread > | mThread |
Property: 'Thread' the udp thread the adapter registers itself to. More... | |
bool | mAllowFailure = false |
Property: 'AllowFailure' if binding to socket is allowed to fail on initialization. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Protected Member Functions | |
virtual bool | onStart (utility::ErrorState &errorState) override final |
virtual void | onStop () override final |
void | onProcess () override final |
![]() | |
void | process () |
bool | handleAsioError (const std::error_code &errorCode, utility::ErrorState &errorState, bool &success) |
asio::io_context & | getIOContext () |
Protected Attributes | |
Signal< const UDPPacket & > | packetReceived |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
The UDP Server connects to an endpoint and receives any UDP packets sent to the endpoint. The server will invoke the packetReceived signal when packets are received. The signal will be fired on the thread this UDPServer is registered to, see UDPThread.
UDPServer | ( | ) |
Constructor
|
virtual |
Destructor
|
finaloverrideprotectedvirtual |
The process function
Implements UDPAdapter.
|
finaloverrideprotectedvirtual |
Called when server socket needs to be created
errorState | The error state |
Implements UDPAdapter.
|
finaloverrideprotectedvirtual |
Called when socket needs to be closed
Implements UDPAdapter.
Connects a listener slot to the packetReceived signal. Thread-Safe
slot | the slot that will be invoked when a packet is received |
Disconnects a listener slot from the packetReceived signal. Thread-Safe
slot | the slot that will be disconnected |
std::string mIPAddress = "" |
Property: 'IP Address' local ip address to bind to, if left empty will bind to any local address.
std::vector<std::string> mMulticastGroups |
Property: 'Multicast Groups' multicast groups to join.
int mPort = 13251 |
Property: 'Port' the port the server socket binds to.