Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DimSum

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

This topic is 5740 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!