CAsyncSocket question
-
Hi all, I am using CAsyncSocket derived class for a client server application. I am quite confused about the OnSend() function. When i send any data using Send(), then why exactly do i need OnSend(). What i mean is, if i have already sent the data using Send() do i need to send it again in OnSend(). For OnReceive() i understand that whenever there is some data available in the buffer, it will be called and we can receive the message. There is no special requirement to call Receive() explicitly outside, so that OnReceive() will be called. Can anyone please answer that. To put it more clearly, do i need to implement OnSend() to send out data ? Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
-
Hi all, I am using CAsyncSocket derived class for a client server application. I am quite confused about the OnSend() function. When i send any data using Send(), then why exactly do i need OnSend(). What i mean is, if i have already sent the data using Send() do i need to send it again in OnSend(). For OnReceive() i understand that whenever there is some data available in the buffer, it will be called and we can receive the message. There is no special requirement to call Receive() explicitly outside, so that OnReceive() will be called. Can anyone please answer that. To put it more clearly, do i need to implement OnSend() to send out data ? Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
-
Hi all, I am using CAsyncSocket derived class for a client server application. I am quite confused about the OnSend() function. When i send any data using Send(), then why exactly do i need OnSend(). What i mean is, if i have already sent the data using Send() do i need to send it again in OnSend(). For OnReceive() i understand that whenever there is some data available in the buffer, it will be called and we can receive the message. There is no special requirement to call Receive() explicitly outside, so that OnReceive() will be called. Can anyone please answer that. To put it more clearly, do i need to implement OnSend() to send out data ? Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
OnSend() is a notification to your socket that it is ok to send data. When you call Send() to send your data, you should wait for a call to your OnSend() before sending more data. Brian
-
OnSend() is a notification to your socket that it is ok to send data. When you call Send() to send your data, you should wait for a call to your OnSend() before sending more data. Brian
So, does that mean that whenever i need to send a message, i need to raise a flag and then in OnSend() send the message only when that flag is set ? Is it the way it is done in standard programs. Please help. thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
-
So, does that mean that whenever i need to send a message, i need to raise a flag and then in OnSend() send the message only when that flag is set ? Is it the way it is done in standard programs. Please help. thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
Yes, you are right on both accounts. There are numerous code examples here to help. Brian