netDestroyDatagram function net

void netDestroyDatagram(
  1. Pointer<NetDatagram> dgram
)

Dispose of a datagram packet previously received.

You must pass packets received through NET_ReceiveDatagram to this function when you are done with them. This will free resources used by this packet and unref its NET_Address.

If you want to save the sender's address from the packet past this time, it is safe to call NET_RefAddress() on the address and hold onto its pointer, so long as you call NET_UnrefAddress() on it when you are done with it.

Once you call this function, the datagram pointer becomes invalid and should not be used again by the app.

\param dgram the datagram packet to destroy.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL_net 3.0.0.

extern SDL_DECLSPEC void SDLCALL NET_DestroyDatagram(NET_Datagram *dgram)

Implementation

void netDestroyDatagram(Pointer<NetDatagram> dgram) {
  final netDestroyDatagramLookupFunction = _libNet
      .lookupFunction<
        Void Function(Pointer<NetDatagram> dgram),
        void Function(Pointer<NetDatagram> dgram)
      >('NET_DestroyDatagram');
  return netDestroyDatagramLookupFunction(dgram);
}