Click here to Skip to main content
15,914,066 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionpls help me Pin
saisp9-Jun-07 18:58
saisp9-Jun-07 18:58 
AnswerRe: pls help me Pin
Iain Clarke, Warrior Programmer10-Jun-07 3:15
Iain Clarke, Warrior Programmer10-Jun-07 3:15 
QuestionAbout popupMenu Pin
kcynic9-Jun-07 18:32
kcynic9-Jun-07 18:32 
AnswerRe: About popupMenu Pin
Mark Salsbery9-Jun-07 18:47
Mark Salsbery9-Jun-07 18:47 
Questionadding to char arrays together for one arg Pin
NZSmartie9-Jun-07 17:59
NZSmartie9-Jun-07 17:59 
AnswerRe: adding to char arrays together for one arg Pin
Mark Salsbery9-Jun-07 18:23
Mark Salsbery9-Jun-07 18:23 
AnswerRe: adding to char arrays together for one arg Pin
Iain Clarke, Warrior Programmer10-Jun-07 3:20
Iain Clarke, Warrior Programmer10-Jun-07 3:20 
QuestionHelp , why WSAGetLastError( ) return 2? Pin
danscort yu9-Jun-07 16:42
danscort yu9-Jun-07 16:42 
visual 2005 sp1

the code in debug mode
s is a SOCKET value and set in unblock mode
pbuff is a char * pointer
isize is a int value , is the buff size of pbuff , about 6440

int i=recv(s,pbuff, isize , 0);

if(i==SOCKET_ERROR) //<--here is right
{
iierror=WSAGetLastError( );
if(iierror!=WSAEWOULDBLOCK) // if it is not a block error
{
return -1;
}
else retur 0 ; // need block and recv again
}

//--------------------------------------------------------
the code can run no error in release mode , and if the client send data immediately ,
it is ok , but if data no coming ,
the iierror value is 2, not wsaewouldblock , why?

refer to MSDN, the SOCKET error return more than 10000 ,
and I suppos it is a error of win api parameters, but when the data arrive in no time ,
the function runs ok , that means all parameters is ok ,
who knows why? and how to do with it?
should I replace with if(iierror!=2 || iierror!=WSAEWOULDBLOCK) return -1;


Thank you

Hello,
pleasure to meet you.

AnswerRe: Help , why WSAGetLastError( ) return 2? Pin
danscort yu9-Jun-07 17:12
danscort yu9-Jun-07 17:12 
AnswerRe: Help , why WSAGetLastError( ) return 2? Pin
Mark Salsbery9-Jun-07 18:17
Mark Salsbery9-Jun-07 18:17 
GeneralRe: Help , why WSAGetLastError( ) return 2? Pin
danscort yu9-Jun-07 21:13
danscort yu9-Jun-07 21:13 
GeneralRe: Help , why WSAGetLastError( ) return 2? Pin
Mark Salsbery10-Jun-07 5:44
Mark Salsbery10-Jun-07 5:44 
GeneralRe: Help , why WSAGetLastError( ) return 2? Pin
danscort yu11-Jun-07 1:02
danscort yu11-Jun-07 1:02 
QuestionRe: Help , why WSAGetLastError( ) return 2? Pin
Mark Salsbery11-Jun-07 6:25
Mark Salsbery11-Jun-07 6:25 
QuestionPassing a class function pointer as an argument Pin
Cyrilix9-Jun-07 14:30
Cyrilix9-Jun-07 14:30 
AnswerRe: Passing a class function pointer as an argument Pin
Nemanja Trifunovic9-Jun-07 14:48
Nemanja Trifunovic9-Jun-07 14:48 
GeneralRe: Passing a class function pointer as an argument Pin
Cyrilix9-Jun-07 14:52
Cyrilix9-Jun-07 14:52 
AnswerRe: Passing a class function pointer as an argument Pin
Mark Salsbery9-Jun-07 15:01
Mark Salsbery9-Jun-07 15:01 
GeneralRe: Passing a class function pointer as an argument Pin
Cyrilix9-Jun-07 15:17
Cyrilix9-Jun-07 15:17 
GeneralRe: Passing a class function pointer as an argument Pin
Mark Salsbery9-Jun-07 15:28
Mark Salsbery9-Jun-07 15:28 
GeneralRe: Passing a class function pointer as an argument Pin
Cyrilix9-Jun-07 15:40
Cyrilix9-Jun-07 15:40 
GeneralRe: Passing a class function pointer as an argument Pin
Mark Salsbery9-Jun-07 15:59
Mark Salsbery9-Jun-07 15:59 
QuestionSet registry key permissions Pin
KellyR9-Jun-07 10:42
KellyR9-Jun-07 10:42 
QuestionRe: Set registry key permissions Pin
KellyR9-Jun-07 12:07
KellyR9-Jun-07 12:07 
AnswerRe: Set registry key permissions Pin
KellyR10-Jun-07 6:51
KellyR10-Jun-07 6:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.