Tool/software: TI-RTOS
What is the correct way to check for a valid socket? The NDK API refference says "For compatibility, network applications must use the NDK header files, and use INVALID_SOCKET for an error condition (not -1),"
Yet the TI-RTOS example projects all have something like:
server = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (server == -1) { System_printf("Error: socket not created.\n"); goto shutdown; }
And from socketndk.h
#define INVALID_SOCKET (void *)0xFFFFFFFF /* Used by socket() and accept() */