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

3.4.8 SDLNet_UDP_SendV

int SDLNet_UDP_SendV(UDPsocket sock, UDPpacket **packetV, int npackets)

sock
A valid UDPsocket.
packetV
The vector of packets to send.
npackets
number of packets in the packetV vector to send.

Send npackets of packetV using the specified sock socket.
Each packet is sent in the same way as in SDLNet_UDP_Send (see section 3.4.6 SDLNet_UDP_Send).
Don't forget to set the length of the packets in the len element of the packets you are sending!

Returns: The number of destinations sent to that worked, for each packet in the vector, all summed up. 0 is returned on errors.

 
// send a vector of 10 packets using UDPsocket
//UDPsocket udpsock;
//UDPpacket **packetV;
int numsent;

numsent=SDLNet_UDP_SendV(udpsock, packetV, 10);
if(!numsent) {
    printf("SDLNet_UDP_SendV: %s\n", SDLNet_GetError());
    // do something because we failed to send
    // this may just be because no addresses are bound to the channels...
}

See Also:
3.4.3 SDLNet_UDP_Bind, 3.4.6 SDLNet_UDP_Send, 3.4.7 SDLNet_UDP_Recv, 3.4.9 SDLNet_UDP_RecvV, 4.4 UDPpacket, 4.3 UDPsocket



This document was generated on November, 3 2009 using texi2html