shahin
January 6th, 2005, 05:05 PM
I have a simple client and server application which is writen in MFC. My server outputs data in TCPIP mode and this is my write function:
unsigned int CClientSock::Write( const unsigned char* Buffer, const unsigned long numBytes, const unsigned short TxID, const unsigned int timesToIssue, const unsigned int delayInMilliseconds)
{
int iNumBytes = numBytes;
if(Send(Buffer, numBytes) == SOCKET_ERROR)
{
NError::WarningMessage(NInternetComm::GetErrorEntry(GetLastError()));
iNumBytes = -1;
}
return iNumBytes;
}
and in my client I do a recive. very simple, I know :(
My problem is that, in my client sometimes, I need to run in debug mode ( visual C++) and have a break point. In this condition, my server keeps on sending data and after a while, it hangs on send(buffer,... function.
I thought, since this is TCPIP and my reciver needs to send acknowledgement back, then the first time server tries to send something,( after I encountered a break point in my client) then send should get an error. But it is not getting it.
I am sooo confuse, I know this is stupid question and you wonder why I need to do this and why shouldn't I debug in any other method.
But I am doing this for someone and they want to do it this way. So is there a work around ?? Or is this way of debuging even possibel??
Anyway, help is greatly apperitiated.
unsigned int CClientSock::Write( const unsigned char* Buffer, const unsigned long numBytes, const unsigned short TxID, const unsigned int timesToIssue, const unsigned int delayInMilliseconds)
{
int iNumBytes = numBytes;
if(Send(Buffer, numBytes) == SOCKET_ERROR)
{
NError::WarningMessage(NInternetComm::GetErrorEntry(GetLastError()));
iNumBytes = -1;
}
return iNumBytes;
}
and in my client I do a recive. very simple, I know :(
My problem is that, in my client sometimes, I need to run in debug mode ( visual C++) and have a break point. In this condition, my server keeps on sending data and after a while, it hangs on send(buffer,... function.
I thought, since this is TCPIP and my reciver needs to send acknowledgement back, then the first time server tries to send something,( after I encountered a break point in my client) then send should get an error. But it is not getting it.
I am sooo confuse, I know this is stupid question and you wonder why I need to do this and why shouldn't I debug in any other method.
But I am doing this for someone and they want to do it this way. So is there a work around ?? Or is this way of debuging even possibel??
Anyway, help is greatly apperitiated.