MFC - CAsyncSocket class
-
I have a very basic question to ask. I'm not able to find out if the OnReceive() function of the CAsyncSocket class will always be called automatically when a message is sent by the client OR do we have to write code such that the function is called everytime a message is sent?
-
I have a very basic question to ask. I'm not able to find out if the OnReceive() function of the CAsyncSocket class will always be called automatically when a message is sent by the client OR do we have to write code such that the function is called everytime a message is sent?
liz3 wrote:
I'm not able to find out if the OnReceive() function of the CAsyncSocket class will always be called automatically when a message is sent by the client OR do we have to write code such that the function is called everytime a message is sent?
If you have established a connection with the client, the OnReceive() function will be called automtically called when the client sends you a message.
nave [My Articles] [My Blog]
-
liz3 wrote:
I'm not able to find out if the OnReceive() function of the CAsyncSocket class will always be called automatically when a message is sent by the client OR do we have to write code such that the function is called everytime a message is sent?
If you have established a connection with the client, the OnReceive() function will be called automtically called when the client sends you a message.
nave [My Articles] [My Blog]
-
thankyou. But it is not called just the first time right? I mean, client and server establish the connection, client sends a msg to the server. Then, the OnReceive() function is called. But after that, for subsequent msgs sent by the client, will the OnReceive() function be called automatically?
-
thankyou. But it is not called just the first time right? I mean, client and server establish the connection, client sends a msg to the server. Then, the OnReceive() function is called. But after that, for subsequent msgs sent by the client, will the OnReceive() function be called automatically?
-
Yes see
OnReceive()
on MSDN[^]: Notifies this socket that there is data in the buffer for it to retrieve by calling Receive.Webchat in Europe :java: (only 4K)