Abstract:
Techniques are described for reading a plurality of data packets, which can be communicated over a network, without sacrificing the efficiency of network operation, and for reading data packets communicated over a network without unnecessary memory copies. A receive buffer of a first size, which is at least twice a maximum size of data packets in the plurality of data packets, is used. A first amount of data is read into the receive buffer and the size of a last packet contained within the first amount of data is determined. The size of an unread portion of the last read packet is determined and a second amount of data, which is equal to size of an unread portion of the last read packet, is then read into the receive buffer.