Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++
DWORD RecvCount = 0;
 char szBuff1[2048];
 bool stop = false;
 while(!stop)
 {
     ioctlsocket(*socket, FIONREAD, &RecvCount);
     if(RecvCount > 1)
         stop = true;
 }
 int Res = recv(*socket, szBuff1, RecvCount,0);

so I found this code online and I was wondering if it is possible to make a function that dynamically sets RecvBufferSize to incoming data's size, I've tried to do on the code a bit but I did not manage to do it in a strange way, then message me sent to TCP server as results from ioctlsocket (* socket, FIONREAD, & RecvCount);
i really hope someone can help me with this
Posted
Updated 10-Jun-22 5:46am

1 solution

This question was posted in 2014. I'm replying because there was no solution, and someone who comes across this may want an answer.

There is a question on stackoverflow[^] that discusses this.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900