void CFtpc::CloseSocket( SOCKET *socket ) { fd_set read_fds; fd_set error_fds; struct timeval t_timeout; if( *socket != INVALID_SOCKET ) { if( shutdown( *socket, SD_BOTH ) != SOCKET_ERROR ) { FD_ZERO( &read_fds ); FD_ZERO( &error_fds ); FD_SET( *socket, &read_fds ); FD_SET( *socket, &error_fds ); t_timeout.tv_sec = MAX_LINGER_SECONDS; t_timeout.tv_usec = 0; select( 1, &read_fds, NULL, &error_fds, &t_timeout ); } closesocket( *socket ); *socket = INVALID_SOCKET; } }
#define
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)