CSocket::OnReceive()?? how does this work??

Started by
0 comments, last by DimSum 21 years, 6 months ago
Hi all, I''ve been playing around with CSocket for the last few days trying to get a file to send over from a client to a server. Well I''m working on the server side right now, and I''m stuck on how CSocket::OnReceive() works?? I know its a callback function but how do you use it exactly?? right now I use the Listen() function to listen to a port number. But then, how does it know when something is being sent to it?? I''m assuming that OnReceive handles this notification. For the server I have: CSocket sockSrvr; sockSrvr.Create(700); sockSrvr.Listen(); // what i do after this?? How do I use the OnReceive() function to wait for a receive from a client?? I looked at the CHATSRV sample from the Visual Studios documentation but I''m still a confused on how its used. Can someone help me with this?? Can you use code to show me too?? thanks all. -Phil
Advertisement
You have to derive a class from CSocket and override it
I don't like the way it works either, but that was the state-of-the-art OO when MFC was written.

[edited by - Magmai Kai Holmlor on October 3, 2002 11:46:45 PM]
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

This topic is closed to new replies.

Advertisement