Topic: recv - to clear/drop an input queue part tcp a socket
There is a network application in which it is necessary to read from tcp connections a part of the data which is defined by a separator. Everything that behind a separator is intended for following reading. The data not fixed is long, arrives in time intervals. As I understand, that is read recv, is reverse in input queue not to return any more (the variant read everything, prevailed, remaining put reversely). Here flag MSG_PEEK to the aid can come, but confuses necessity of double reading - at first I read in the buffer all (well or in the buffer with in the restricted size) with flag MSG_PEEK, I find in the buffer to divide, I select the data, and I read "" the data from input queue without flag MSG_PEEK that from from there to delete. Perhaps there is a possibility simply to specify to system that it deleted the data from input queue without reading?