Syntax
virtual int beginPacket(
    const char * host, 
    uint16_t port
) = 0;
ContentsIndex
PreviousUpNext
LUDP::beginPacket Method (char *, uint16_t)
LUDP Class | Example
Syntax
virtual int beginPacket(
    const char * host, 
    uint16_t port
) = 0;
Description

Start constructing an UDP datagrams to a remote host specified by URL address and port. Call write() subsequently to construct the datagram content. Then call endPacket() to actually send it.

Parameters
Parameters 
Description 
const char * host 
URL of the remote host
 
uint16_t port 
the port on the remote host
 
Returns

1 if succeeded, 0 if failed. 

 

Example
    udp.begin(1234);   // start UDP on port 1234
    udp.beginPacket("www.somewebsite.com", 56);  // start a packet sending to www.somewebsite.com on port 56.
    udp.write(0);  // write a byte of value 0 to the packet
    udp.endPacket();  // actually send the packet.
File

LUdp.h

Class