blocked on read/recv / how to read/send proper buffers
i am somehow stuck with a beginner networking problem. i generally do not know how to read/recv all data to process it. for instance, taking this example:
now, if i would replace the strncat line with
file = open("test.txt",O_RDONLY);
the while loop finishes and the program ends like it should. with the strncat in place it reads the file but is somehow stuck in the while loop. i wonder what i do wrong there.
possibly i have generally a wrong way of trying to read a buffer with recv/read wrong, possibly somebody can show me what the correct way is to read/send a full buffer. lets say
i have a defined buffer of 1024 bytes but the file is 4094 big.
thank for your answers,