Re: Why it can not work after I delete breakpoint.(attach the CSocketFile object to a CArchive)
Despite any breakpoints in or out. This is
hard to develop socket implementation
with the use of breakpoints... Like Joseph
said, timings are wrong...
My own code do the following way.. and
work very well.
void CMyOwnSocket::OnReceive(int nErrorCode)
// At least, check if something goes wrong with sub system..
if(nErrorCode == WSAENETDOWN)
// Up to you to behave on this..
// I do the process I need before calling the CSocket::OnReceive
static BYTE localbuffer;
int lgtoreceive = 5000; // or some calculation to
know how many bytes to receive..
int lgreceive = Receive(&localbuffer, lgtoreceive); // Acquire the
// Up to you the way to handle the received data..
// .. at last, call the base class implementation... This is a way MSDN
suggest to do.. somewhere
... But there are other ways to handle sockets...
"zjs" <email@example.com> wrote in message
class CChatSocket : public CSocket
void CChatSocket::OnReceive(int nErrorCode)
CSocket::OnReceive(nErrorCode);//Here I insert a breakpoint,
It works well if I insert a breakpoint int the CHATTER (Client). but If I
delete that breakpoint, OnReceive function can not receive anything.(of
course CHATSRVR have the breakpoint too.the onlye changing is breakpoint)
the source code is in MSDN (CHATTER and CHATSRVR)