Archived

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

DimSum

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

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