Does anybody know why ioctlsocket don't work properly.
It must place how much bytes is waiting in socket.
When I place breakpoint to ioctlsocket then this function place how much
bytes is waiting in i_HowMuch. But if I remove breakpoint then in
i_HowMuch just zero. Why that? What's the problem.
I'm using ioctlsocket(...) to know beforehand how much bytes are waiting
me so I can create dynamic buffer.
if(send(ServerSock, Retro, strlen(Retro), 0)==SOCKET_ERROR){
i_ErrorSock=WSAGetLastError();
return false;
}
//memset(sBuf,0,sizeof(sBuf));
if(ioctlsocket(ServerSock,FIONREAD,&i_HowMuch)==SOCKET_ERROR){
i_ErrorSock=WSAGetLastError();
return false;
}
It must place how much bytes is waiting in socket.
When I place breakpoint to ioctlsocket then this function place how much
bytes is waiting in i_HowMuch. But if I remove breakpoint then in
i_HowMuch just zero. Why that? What's the problem.
I'm using ioctlsocket(...) to know beforehand how much bytes are waiting
me so I can create dynamic buffer.
if(send(ServerSock, Retro, strlen(Retro), 0)==SOCKET_ERROR){
i_ErrorSock=WSAGetLastError();
return false;
}
//memset(sBuf,0,sizeof(sBuf));
if(ioctlsocket(ServerSock,FIONREAD,&i_HowMuch)==SOCKET_ERROR){
i_ErrorSock=WSAGetLastError();
return false;
}