sdlNetTcpAccept function

Pointer<TCPsocket> sdlNetTcpAccept(
  1. Pointer<TCPsocket> server
)

Accept an incoming connection on the given server socket.

server must be a socket returned by SDLNet_TCP_Open with an address of INADDR_NONE or INADDR_ANY (a "server socket"). Other sockets do not accept connections.

\param server the server socket to accept a connection on. \returns the newly created socket, or NULL if there was an error.

\since This function is available since SDL_net 2.0.0.

extern DECLSPEC TCPsocket SDLCALL SDLNet_TCP_Accept(TCPsocket server)

Implementation

Pointer<TCPsocket> sdlNetTcpAccept(Pointer<TCPsocket> server) {
  final sdlNetTcpAcceptLookupFunction = libSdl2Net.lookupFunction<
      Pointer<TCPsocket> Function(Pointer<TCPsocket> server),
      Pointer<TCPsocket> Function(
          Pointer<TCPsocket> server)>('SDLNet_TCP_Accept');
  return sdlNetTcpAcceptLookupFunction(server);
}