Sign in to follow this  
tBoai

i already int it BUT why error c2065?

Recommended Posts

void CTcpSock::setKeepAlive( bool keepAlive ) { nlassert(_Sock != INVALID_SOCKET) int b = keepAlive?1:0; the wrong with here: cant find "b" if ( setsockopt( _Sock, SOL_SOCKET, SO_KEEPALIVE, (char*)&b, sizeof(b) ) != 0 ) { throw ESocket( "setKeepAlive failed" ); } }

Share this post


Link to post
Share on other sites
You most likely need to end the previous line (nlassert(...)) with a semicolon (;). I'm not sure that's the problem, but it could be, especially if nlassert is a macro.

Also could you show us the code all the way down to that if statement? Is it right after declaring b?

Share this post


Link to post
Share on other sites
wow!! you right~ it is work now so thank you~


i got that code from Nel library

http://www.nevrax.org/

but that website always stop run at recently~

if you want the code i could send to you by mail

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this