netDestroyDatagramSocket function net

void netDestroyDatagramSocket(
  1. Pointer<NetDatagramSocket> sock
)

Dispose of a previously-created datagram socket.

This will abandon any data queued for sending that hasn't made it to the socket. If you need this data to arrive, you should wait for confirmation from the remote computer in some form that you devise yourself. Queued data is not guaranteed to arrive even if the library made efforts to transmit it here.

Any data that has arrived from the remote end of the connection that hasn't been read yet is lost.

\param sock datagram socket to destroy.

\threadsafety You should not operate on the same socket from multiple threads at the same time without supplying a serialization mechanism. However, different threads may access different sockets at the same time without problems.

\since This function is available since SDL_net 3.0.0.

\sa NET_CreateDatagramSocket \sa NET_SendDatagram \sa NET_ReceiveDatagram

extern SDL_DECLSPEC void SDLCALL NET_DestroyDatagramSocket(NET_DatagramSocket *sock)

Implementation

void netDestroyDatagramSocket(Pointer<NetDatagramSocket> sock) {
  final netDestroyDatagramSocketLookupFunction = _libNet
      .lookupFunction<
        Void Function(Pointer<NetDatagramSocket> sock),
        void Function(Pointer<NetDatagramSocket> sock)
      >('NET_DestroyDatagramSocket');
  return netDestroyDatagramSocketLookupFunction(sock);
}