I have an application that sends and receives small packets of data on a tcp/ip socket.
My application sends the data and then waits for a response.
My applications works great in debug mode but when I try it in release mode I have problems.
I will be sending data packets using:
sendStatus = send( cmdSock, (char *)msg, msgLen, 0 );
if( sendStatus == SOCKET_ERROR )
{
// Send error
}
And receiving:
if( select( 0, &readfds, 0, 0, &timeout ) == 0 )
{
// socket timed out
}
status = recv( cmdSock, (char *)msg, msgLen, 0 );
if( status == SOCKET_ERROR )
{
// recv error
}
The application will be sending many packets about every 1 second. Then randomly, a packet will fail because of a socket timed out.
When the error occurs:
The send command sends the data, No SOCKET_ERROR comes back.
The recv command times out waiting for the response.
When the error occurs the application that is receiving the data packets never received the data packet, and thus does not respond.
Again this ONLY happens in Release configuration, it NEVER fails in Debug configuration.
Has anyone ever seen an issue like this?
Thanks!
John W.