SDL_Struct

Name

UDPpacket -- used with UDPsockets to send and receive data.

Structure Definition

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;

Structure Data

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.

Description

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

See Also

UDP Packets, UDPsocket, IPaddress

UDPpacket (last edited 2008-04-17 08:18:43 by localhost)