In this example when I enlarge the the buffer
65536 bytes I get a stack overflow as soon as I connect (on windows). On linux everything seems fine.
I mean 1024 bytes as the read buffer are probably completely fine, but there are two points I am not sure about:
I am worried that I will run into stack overflows everywhere. 64K are not that many bytes even for the default windows stack size (1MB?), that seems to be smaller than the default linux stack size (8MB?). I could heap allocate everything just to be safe, but that is not an elegant solution.
Where is this stack variable located anyways? I guess the normal stack frame where
rspis pointing is cleared when awaiting. Is there a heap allocation with the local variables?