I have a code like this:
while (!isNeedStop) {
char * data; int len;
getData(data, &len);
send(sock, data, len, 0);
}
getData
produce some data, about 3-5 kb. The profiler shows, that getData and send takes the same time and I want to send data asynchronously - when getData
gets next piece of data, send
sends previous.
I can write a code with additional thread + queue. But maybe Visual Studio alredy has good class for it?
I use Visual Studio 2010.