Tao.Sdl SDK Documentation

SdlNet.SDLNet_UDP_SendV Method 

Send a UDPpacket vector

[Visual Basic]
Public Shared Function SDLNet_UDP_SendV( _
   ByVal sock As IntPtr, _
   ByVal packets As IntPtr, _
   ByVal npackets As Integer _
) As Integer
[C#]
public static int SDLNet_UDP_SendV(
   IntPtr sock,
   IntPtr packets,
   int npackets
);

Parameters

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

Return Value

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

Remarks

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!

Binds to C-function call in SDL_net.h:

                extern DECLSPEC int SDLCALL SDLNet_UDP_SendV(UDPsocket sock, UDPpacket **packets, int npackets)
            

Example

            // 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

SdlNet Class | Tao.Sdl Namespace | SDLNet_UDP_Bind | SDLNet_UDP_Send | SDLNet_UDP_Recv | SDLNet_UDP_RecvV | SdlNet.UDPpacket | SdlNet.UDPsocket