fseek on a socket descriptor to discard socket buffer?
hiho@ll
i have a simple protocol which sends the data size and then the data itself
the function which reads the data gets a char pointer and the size of the char buffer
now i read the size of the data which should be available
and then i read the data in the buffer
if the buffersize < datasize i want to discard the rest of the data which is available
do i have to use read(); until there is no more data, or can i do something like a fseek(); on the stream? or is there a function which can discard the next n bytes which become available?
thx@ll
|