UDP: User Datagram Protocol¶
https://en.m.wikipedia.org/wiki/User_Datagram_Protocol
Connection API¶
-
typedef Delegate<void(UdpConnection &connection, char *data, int size, IpAddress remoteIP, uint16_t remotePort)>
UdpConnectionDataDelegate¶
-
class
UdpConnection¶ - #include <UdpConnection.h>
Subclassed by DnsServer, NtpClient
Public Functions
-
UdpConnection()¶
-
UdpConnection(UdpConnectionDataDelegate dataHandler)¶
-
virtual
~UdpConnection()¶
-
virtual bool
listen(int port)
-
virtual bool
connect(IpAddress ip, uint16_t port)
-
virtual void
close()
-
virtual bool
send(const char *data, int length)
-
bool
sendString(const char *data)
-
bool
sendString(const String &data)
-
virtual bool
sendTo(IpAddress remoteIP, uint16_t remotePort, const char *data, int length)
-
bool
sendStringTo(IpAddress remoteIP, uint16_t remotePort, const char *data)
-
bool
sendStringTo(IpAddress remoteIP, uint16_t remotePort, const String &data)
-