just playing around with winsock and trying to set up a remote shell for my windows box and having a little trouble with the fwrite and fread it would appear
pPipe = _popen("cmd", "rw");
while (!feof(pPipe) && !ferror(pPipe))
fread(psBuffer, sizeof(char), ((string)psBuffer).length(), pPipe);//waits here :|
any ideas as to why my fread causes the program to just stall and wait? is fflush the answer(didnt look like it when i tried)?
anyways the general idea is user sends command which program sends off to cmd.exe which then displays the output back to the user...
thank you for your time