sdlNetTcpClose function

void sdlNetTcpClose(
  1. Pointer<TCPsocket> sock
)

Close a TCP network socket.

All TCP sockets (server and non-server) are deinitialized through this function. Call this once you are done with a socket, and assume the handle is invalid once you have.

Closing a socket will disconnect any communication and free its resources.

\param sock socket to close.

\since This function is available since SDL_net 2.0.0.

extern DECLSPEC void SDLCALL SDLNet_TCP_Close(TCPsocket sock)

Implementation

void sdlNetTcpClose(Pointer<TCPsocket> sock) {
  final sdlNetTcpCloseLookupFunction = libSdl2Net.lookupFunction<
      Void Function(Pointer<TCPsocket> sock),
      void Function(Pointer<TCPsocket> sock)>('SDLNet_TCP_Close');
  return sdlNetTcpCloseLookupFunction(sock);
}