Link to home
Start Free TrialLog in
Avatar of srik18
srik18

asked on

VC++ MFC socket flush!!

Hi,
I have a question in VC++.
I am using CSockets. I have a program where in i send messages through a socket in a for loop. However i need to know how to flush the messages so that before the next message the current message is passed on through the socket. The problem right now is sometimes the messages are being transferred one after another the way i would like and sometimes they are passed at once.
Thanks in advance.
S.
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of srik18
srik18

ASKER

Hi,
Thank you for your answers. I kind of solved my problem by doing a sleep in the for loop.
I think yuri's answer was more close but i am going ahead and splitting the points between the 2 of you.
AlexFm, what i meant by "they are passed at once" was that i had the sent() function in a for loop and hence instead of my messages being delivered  in each iteration...they were being sent all at once as it was not flushing to the socket in each iteration. I hope i am clear in what i explained.
Regards.
S.