[ < ] [ > ]   [ << ] [ 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;

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.
The data contained in this packet, this is the meat.
This is the meaningful length of the data in bytes.
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.
This contains the number of bytes sent, or a -1 on errors, after sending. This is useless for a received packet.
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 August, 6 2004 using texi2html