I can connect to a computer and successfully send Data, however I cannot get the Callbacks working correctly(such as OnClose, OnReceive, OnListen, OnConnect, OnAccept etc..). I checked out MSDN and they do something like this:
Code:
CMyAsyncSocket::OnClose(int nErrorCode)
{
//Their Notification Code here.
}
I have not used Derivatives before so I tried to create one of my own. I was connecting by using an Object named 'sock'. This is how I declared my object, then tried to declare the Derivatives:
Code:
CAsyncSocket sock;
class sock : public CAsyncSocket
{
virtual void OnClose(int nErrorCode);
};
So then I can still make my connections using the 'sock' functions, so then I tried this:
Code:
sock::OnClose(int nErrorCode)
{
//My Notifications here, yet they are never executed because this function is never called for some reason.
}
So when the connection is Closed it is susposed to use the Callback event and notify me by running the function sock::OnClose, however for some reason, it does not.
I have never used a Derivative of a class like this before, so I am somewhat confused. Any help would be appreciated, I have been using MFC. Thanks.