0cad56c8c6
test_UDPpacketVBuffer for testing.
26 lines
426 B
C++
26 lines
426 B
C++
#pragma once
|
|
|
|
#include <SDL_net.h>
|
|
|
|
class UDPpacketVBuffer
|
|
{
|
|
int npackets;
|
|
UDPpacket** packetV;
|
|
public:
|
|
UDPpacketVBuffer (UDPpacket* src, const void* buf, const size_t size);
|
|
~UDPpacketVBuffer (void)
|
|
{
|
|
if (packetV)
|
|
{
|
|
SDLNet_FreePacketV (packetV);
|
|
packetV = NULL;
|
|
}
|
|
}
|
|
int Send (UDPsocket sock)
|
|
{
|
|
int numsent;
|
|
numsent = SDLNet_UDP_SendV (sock, packetV, npackets);
|
|
return numsent;
|
|
}
|
|
};
|