[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4 UDPpacket

 
typedef struct {
    int channel;          /* The src/dst channel of the packet */
    Uint8 *data;          /* The packet data */
    int len;              /* The length of the packet data */
    int maxlen;           /* The size of the data buffer */
    int status;           /* packet status after sending */
    IPaddress address;    /* The source/dest address of an 
                                   incoming/outgoing packet */
} UDPpacket;

channel
The (software) channel number for this packet. This can also be used as a priority value for the packet. If no channel is assigned, the value is -1.
data
The data contained in this packet, this is the meat.
len
This is the meaningful length of the data in bytes.
maxlen
This is size of the data buffer, which may be larger than the meaningful length. This is only used for packet creation on the senders side.
status
This contains the number of bytes sent, or a -1 on errors, after sending. This is useless for a received packet.
address
This is the resolved IPaddress to be used when sending, or it is the remote source of a received packet.

This struct is used with UDPsockets to send and receive data. It also helps keep track of a packets sending/receiving settings and status. The channels concept helps prioritize, or segregate differring types of data packets.

See Also:
3.5 UDP Packets, 4.3 UDPsocket, 4.1 IPaddress



This document was generated on November, 3 2009 using texi2html