casyncsocket

What's behind the CAsyncSocket assertion problems and "improper argument" errors in my MFC sockets code?

I was asked to look at some code for a friend. (I rightly hesitated due to the MFC and lots of bad code, but he won...) This is a dialog box based application that uses a CAsyncSocket. The problem manifests in some nonstop debugbreaks and other similar things - there are also problem with an MFC ENSURE() macro - checking the socket ...

CAsyncSocket::Close Crashes

Hey, im doing some client/server stuff in a windows service. Pretty much new to this stuff. The problem I'm encountering is that when I try to stop the service through Service Manager, it crashes. I added some MessageBoxes code, to trace where they are crashing and I found that when it closes the listener socket it crashes!!! I tried t...

VC++ 6.0: Why is CASyncSocket::GetLastError() causing an access violation?

I'm using Visual C++ 6.0. I'm not sure of the service pack level of the visual studio installation, but the OS is Win 2K SP4. The failing code is part of a DLL. Here's the code: EIO::OpenConnection() { m_Client = new CSocket(); if(m_Client->Create() == 0) { delete m_Client; m_Client = NULL; return CAs...

mfc socket onreceive is not called

I am making a project in VC++ using mfc. I'm connecting to a server, sending a notification message like "user blabla" and start awaiting messages from that server. The server receives the initial message and responds with a message but the onReceive method isn't called on the client. The client is receiving the message because when I ca...