Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear,

I was try close socket but VC compiler report error message "error C2065: 'MAX_LINGER_SECONDS' : undeclared identifier".
Would you let me know, which header file have to include?
C++
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;
	}
}
Posted
Updated 14-Oct-10 17:38pm
v3

Didn't find any such thing.
Maybe its a custom defined constant.
You could define it yourself using #define.
 
Share this answer
 
That value is an application specific value, and therefor cannot be declared in a common header. Follow supermans suggestion and define it yourself.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900