File Information
Library: IoT/UDP
Package: Generated
Header: IoT/UDP/IUDPEndpoint.h
Description
The UDPEndpoint is used to receive and send UDP packets.
Inheritance
Direct Base Classes: Poco::OSP::Service
All Base Classes: Poco::OSP::Service, Poco::RefCountedObject
Known Derived Classes: UDPEndpointRemoteObject
Member Summary
Member Functions: address, isA, remoteAddress, remoting__enableEvents, remoting__typeId, sendPacket, type
Inherited Functions: duplicate, isA, referenceCount, release, type
Types Aliases
Ptr
using Ptr = Poco::AutoPtr < IUDPEndpoint >;
Constructors
IUDPEndpoint
IUDPEndpoint();
Creates a IUDPEndpoint.
Destructor
~IUDPEndpoint
virtual ~IUDPEndpoint();
Destroys the IUDPEndpoint.
Member Functions
address
virtual IoT::UDP::EndpointAddress address() const = 0;
Returns the local address the socket of the endpoint has been bound to.
isA
bool isA(
const std::type_info & otherType
) const;
Returns true if the class is a subclass of the class given by otherType.
See also: Poco::OSP::Service::isA()
remoteAddress
virtual Poco::Nullable < IoT::UDP::EndpointAddress > remoteAddress() const = 0;
Returns the remote address the socket of the endpoint is "connected" to, or null if the socket is not connected.
If a remote address has been specified in the configuration, packets can only be sent to that address and furthermore, only packets sent from the remote address are accepted.
Note that UDP sockets are not actually connected, the remote address merely acts as the default destination address for sendPacket().
remoting__enableEvents
virtual std::string remoting__enableEvents(
Poco::RemotingNG::Listener::Ptr pListener,
bool enable = bool (true)
) = 0;
Enable or disable delivery of remote events.
The given Listener instance must implement the Poco::RemotingNG::EventListener interface, otherwise this method will fail with a RemotingException.
This method is only used with Proxy objects; calling this method on a RemoteObject will do nothing.
remoting__typeId
static const Poco::RemotingNG::Identifiable::TypeId & remoting__typeId();
Returns the TypeId of the class.
sendPacket
virtual void sendPacket(
const std::vector < char > & payload,
const IoT::UDP::EndpointAddress & destination = IoT::UDP::EndpointAddress ()
) = 0;
Sends the given payload to the given destination address, or to the remote address, if one has been configured.
If the endpoint has been connected to a remote address, the destination address must be omitted.
type
const std::type_info & type() const;
Returns the type information for the object's class.
See also: Poco::OSP::Service::type()
Variables
packetReceived
Poco::BasicEvent < const IoT::UDP::Packet > packetReceived;