Original Post
Hello, I'm having some troubles with my code to recv() data from a website. In fact it's from google, I am making a research on it. I uses blocking sockets. Here is the code:
Quote:The problems are: 1) I am getting extra char in the buffer (string). I could add make a function just before "buffer += buf", with a loop looking for '\n' and setting '\0' after it, but I wonder if something faster exists, maybe something that would rather not use char []. 2) This is a little weird, after getting the page (after ) I get the wide char showing buf[...] is empty, but after it I get a part of the page I alreagy got, and this I don't know why. Thanks for your help !
string buffer; int bytes; do { char buf[10000]; bytes = recv(googleport, buf, sizeof(buf), 0); buffer += buf; } while (bytes > 0);