void ServerSocket_destroy(ServerSocket socket) { closeAndShutdownSocket(socket->fd); free(socket); }
void Socket_destroy(Socket socket) { closeAndShutdownSocket(socket->fd); /* Wait for other threads to realize that the socket has been closed */ Thread_sleep(100); free(socket); }
void Socket_destroy(Socket self) { int fd = self->fd; self->fd = -1; closeAndShutdownSocket(fd); Thread_sleep(10); free(self); }
void Socket_destroy(Socket self) { int fd = self->fd; self->fd = -1; closeAndShutdownSocket(fd); Thread_sleep(10); GLOBAL_FREEMEM(self); }